guessing-game

This commit is contained in:
Alexander Heldt
2025-11-01 13:47:10 +01:00
parent f83515caf0
commit d1c8114f07
10 changed files with 311 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
import exercism/should
import exercism/test_runner
import guessing_game
pub fn main() {
test_runner.main()
}
pub fn reply_42_test() {
guessing_game.reply(42)
|> should.equal("Correct")
}
pub fn reply_41_test() {
guessing_game.reply(41)
|> should.equal("So close")
}
pub fn reply_43_test() {
guessing_game.reply(43)
|> should.equal("So close")
}
pub fn reply_40_test() {
guessing_game.reply(40)
|> should.equal("Too low")
}
pub fn reply_1_test() {
guessing_game.reply(1)
|> should.equal("Too low")
}
pub fn reply_44_test() {
guessing_game.reply(44)
|> should.equal("Too high")
}
pub fn reply_100_test() {
guessing_game.reply(100)
|> should.equal("Too high")
}