Skip to content

Commit

Permalink
add test_map_eq to test-words. missing in word-count (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
axtens authored Sep 13, 2023
1 parent c14cfee commit 3d91692
Show file tree
Hide file tree
Showing 25 changed files with 336 additions and 100 deletions.
14 changes: 14 additions & 0 deletions exercises/practice/acronym/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/affine-cipher/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/armstrong-numbers/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/atbash-cipher/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/bob/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/collatz-conjecture/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/darts/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/gigasecond/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/hamming/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/hello-world/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/isogram/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/leap/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/luhn/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/pangram/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/raindrops/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/resistor-color/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/reverse-string/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/roman-numerals/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
14 changes: 14 additions & 0 deletions exercises/practice/series/test-words.8th
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ needs console/loaded
then
;


: test_map_eq \ m m --
decr-test-count
isword? !if swap then
w:exec
' n:= m:= if
2drop
con:green con:onBlack . space " ... OK" . con:white con:onBlack cr
else
2drop
con:red con:onBlack . space " ... FAIL" . con:white con:onBlack cr
then
;

: test_map_neq \ m m --
decr-test-count
isword? !if swap then
Expand Down
Loading

0 comments on commit 3d91692

Please sign in to comment.