Skip to main content

Nim

Versions#

  • 1.0

Test Frameworks#

unittest

Tests are currently executed using the following:

# tests.nim
import unittest, codewars_output
addOutputFormatter(OutputFormatter(newCodewarsOutputFormatter()))
import solution
include solution_tests

The custom output formatter is open sourced at Codewars/nim-unittest.

Using Preloaded Code#

Preloaded

proc f*(x, y: int): int = x + y

Solution

import setup # required
proc add*(x, y, z: int): int = f(x, y) + z

Tests

suite "add(x, y, z) using preloaded f(x, y)":
  test "works":
    check(add(1, 1, 1) == 3)

Timeout#

12 seconds

Packages#

None

Services#

None

Language ID#

nim