no need for separate test file

This commit is contained in:
Daylin Morgan 2023-12-01 06:26:20 -06:00
parent 3759966ea6
commit 19f37ece40
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -30,27 +30,18 @@ proc partOne*(input: string): int = 0
proc partTwo*(input: string): int = 0 proc partTwo*(input: string): int = 0
when isMainModule: when isMainModule:
echo partOne(example) import std/unittest
echo partOne(input)
echo partTwo(example)
echo partTwo(input)
"""
let test = fmt"""
import std/unittest
import ./solution
suite "day {day}":
test "part one":
check partOne(example) == 0
check partOne(input) == 0
test "part two":
check partTwo(example) == 0
check partTwo(input) == 0
suite "day {day}":
test "part one":
check partOne(example) == 0
check partOne(input) == 0
test "part two":
check partTwo(example) == 0
check partTwo(input) == 0
""" """
let d = fmt"solutions/day{day:0>2}" let d = fmt"solutions/day{day:0>2}"
writeFile(d / "solution.nim", solution) writeFile(d / "solution.nim", solution)
writeFile(d / "test.nim", test)
proc newDay(year, day: int) = proc newDay(year, day: int) =
let d = fmt"solutions/day{day:0>2}" let d = fmt"solutions/day{day:0>2}"