Skip to content

Commit

Permalink
Add pending test support to two-fer (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras committed Sep 25, 2023
1 parent b4a45a3 commit f9adedf
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
38 changes: 32 additions & 6 deletions exercises/practice/two-fer/two-fer-test.arr
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,40 @@ use context essentials2020

include file("two-fer.arr")

check "no name given":
two-fer("") is "One for you, one for me."
#|
When working offline, all tests except the first one are skipped by default.
Once you get the first test running, unskip the next one until all tests pass locally.
Check the block comment below for further details.
|#

fun no-name-given():
check "no name given":
two-fer("") is "One for you, one for me."
end
end

check "a name given":
two-fer("Alice") is "One for Alice, one for me."
fun a-name-given():
check "a name given":
two-fer("Alice") is "One for Alice, one for me."
end
end

check "another name given":
two-fer("Bob") is "One for Bob, one for me."
fun another-name-given():
check "another name given":
two-fer("Bob") is "One for Bob, one for me."
end
end

#|
Code to run each test. Each line corresponds to a test above and whether it should be run.
To mark a test to be run, replace `false` with `true` on that same line after the comma.
test(test-a, true) will be run. test(test-a, false) will be skipped.
|#

data TestRun: test(run, active) end

[list:
test(no-name-given, true),
test(a-name-given, false),
test(another-name-given, false)
].each(lam(t): when t.active: t.run() end end)
2 changes: 1 addition & 1 deletion exercises/practice/two-fer/two-fer.arr
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ use context essentials2020 # Don't delete this line when using Pyret on Exercism
provide: two-fer end

fun two-fer(name):
panic("Please implement the two-fer function")
raise("please implement the two-fer function")
end

0 comments on commit f9adedf

Please sign in to comment.