Skip to content

Commit 49d0b5a

Browse files
committed
Use check instead of assert
1 parent 10b8138 commit 49d0b5a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ After you create a new project based on the current template repository using th
4545
└── src
4646
├── Day01.kt An empty implementation for the first AoC day
4747
├── Day01.txt An empty file for the Day 01 input data
48-
├── Day01_test.txt An optional Day 01 test input data used for assertion
48+
├── Day01_test.txt An optional Day 01 test input data used for checks
4949
└── Utils.kt A set of utility methods shared across your days
5050
```
5151

@@ -68,14 +68,14 @@ fun main() {
6868
The [`Utils.kt`][file:utils] file also contains the `String.md5()` method for generating MD5 has out of the given string and expects more helper functions for the sake of the [KISS principle][kiss].
6969

7070
Each puzzle describes some test conditions, a small portion of the information that helps check if the produced value for the given test input is valid.
71-
To handle that case, you can put such an input into a separated file and perform a standard assertion against the output, like:
71+
To handle that case, you can put such an input into a separated file and perform a check against the output, like:
7272

7373
```kotlin
7474
fun main() {
7575
// ...
7676

7777
val testInput = readInput("Day01_test")
78-
assert(part1(testInput) == 13)
78+
check(part1(testInput) == 13)
7979
}
8080
```
8181

src/Day01.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fun main() {
99

1010
// test if implementation meets criteria from the description, like:
1111
val testInput = readInput("Day01_test")
12-
assert(part1(testInput) == 1)
12+
check(part1(testInput) == 1)
1313

1414
val input = readInput("Day01")
1515
println(part1(input))

0 commit comments

Comments
 (0)