Nim
Versions
- 1.6
Test Frameworks
Tests are currently executed using the following:
# tests.nim
import unittest, codewars_output
addOutputFormatter(OutputFormatter(newCodewarsOutputFormatter()))
import solution
include solution_tests# tests.nim
import unittest, codewars_output
addOutputFormatter(OutputFormatter(newCodewarsOutputFormatter()))
import solution
include solution_testsThe custom output formatter is open sourced at codewars/nim-unittest.
Using Preloaded Code
Preloaded
proc f*(x, y: int): int = x + yproc f*(x, y: int): int = x + ySolution
import setup # required
proc add*(x, y, z: int): int = f(x, y) + zimport setup # required
proc add*(x, y, z: int): int = f(x, y) + zTests
suite "add(x, y, z) using preloaded f(x, y)":
test "works":
check(add(1, 1, 1) == 3)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