Skip to content

Commit

Permalink
Adding back the test case for negative inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
ageron committed Aug 26, 2024
1 parent 15678ae commit 241e34e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion exercises/practice/grains/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ description = "returns the number of grains on the square -> square 0 is invalid

[61974483-eeb2-465e-be54-ca5dde366453]
description = "returns the number of grains on the square -> negative square is invalid"
include = false

[a95e4374-f32c-45a7-a10d-ffec475c012f]
description = "returns the number of grains on the square -> square greater than 64 is invalid"
Expand Down
3 changes: 3 additions & 0 deletions exercises/practice/grains/grains-test.roc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ expect grainsOnSquare 64 == Ok 9223372036854775808
# square 0 is invalid
expect grainsOnSquare 0 == Err "square must be between 1 and 64"

# negative square is invalid
expect grainsOnSquare -1 == Err "square must be between 1 and 64"

# square greater than 64 is invalid
expect grainsOnSquare 65 == Err "square must be between 1 and 64"

Expand Down

0 comments on commit 241e34e

Please sign in to comment.