mirror of
https://github.com/daylinmorgan/advent-of-code-2023.git
synced 2024-12-22 03:10:44 -06:00
no need for separate test file
This commit is contained in:
parent
3759966ea6
commit
19f37ece40
1 changed files with 8 additions and 17 deletions
|
@ -30,27 +30,18 @@ proc partOne*(input: string): int = 0
|
|||
proc partTwo*(input: string): int = 0
|
||||
|
||||
when isMainModule:
|
||||
echo partOne(example)
|
||||
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
|
||||
import std/unittest
|
||||
|
||||
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}"
|
||||
writeFile(d / "solution.nim", solution)
|
||||
writeFile(d / "test.nim", test)
|
||||
|
||||
proc newDay(year, day: int) =
|
||||
let d = fmt"solutions/day{day:0>2}"
|
||||
|
|
Loading…
Reference in a new issue