Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/practice/accumulate/accumulate/accumulate.factor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
USING: kernel ;
USING: kernel locals ;
IN: accumulate

:: accum ( seq quot: ( x -- y ) -- newseq )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
USING: kernel ;
IN: all-your-base

:: rebase ( digits input-base output-base -- digits' )
: rebase ( digits input-base output-base -- digits' )
"unimplemented" throw ;
2 changes: 1 addition & 1 deletion exercises/practice/matching-brackets/.meta/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module MatchingBrackets
function gen_test_case(case)
value = escape_factor(case["input"]["value"])
expected = case["expected"] ? "t" : "f"
return """{ $(expected) } [ "$(value)" paired? ] unit-test"""
return """{ $(expected) }\n[ "$(value)" paired? ] unit-test"""
end

end
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,83 @@ USING: exercism-tools io kernel matching-brackets tools.test unicode ;
IN: matching-brackets.tests

"paired square brackets" description
{ t } [ "[]" paired? ] unit-test
{ t }
[ "[]" paired? ] unit-test

STOP-HERE

"empty string" description
{ t } [ "" paired? ] unit-test
{ t }
[ "" paired? ] unit-test

"unpaired brackets" description
{ f } [ "[[" paired? ] unit-test
{ f }
[ "[[" paired? ] unit-test

"wrong ordered brackets" description
{ f } [ "}{" paired? ] unit-test
{ f }
[ "}{" paired? ] unit-test

"wrong closing bracket" description
{ f } [ "{]" paired? ] unit-test
{ f }
[ "{]" paired? ] unit-test

"paired with whitespace" description
{ t } [ "{ }" paired? ] unit-test
{ t }
[ "{ }" paired? ] unit-test

"partially paired brackets" description
{ f } [ "{[])" paired? ] unit-test
{ f }
[ "{[])" paired? ] unit-test

"simple nested brackets" description
{ t } [ "{[]}" paired? ] unit-test
{ t }
[ "{[]}" paired? ] unit-test

"several paired brackets" description
{ t } [ "{}[]" paired? ] unit-test
{ t }
[ "{}[]" paired? ] unit-test

"paired and nested brackets" description
{ t } [ "([{}({}[])])" paired? ] unit-test
{ t }
[ "([{}({}[])])" paired? ] unit-test

"unopened closing brackets" description
{ f } [ "{[)][]}" paired? ] unit-test
{ f }
[ "{[)][]}" paired? ] unit-test

"unpaired and nested brackets" description
{ f } [ "([{])" paired? ] unit-test
{ f }
[ "([{])" paired? ] unit-test

"paired and wrong nested brackets" description
{ f } [ "[({]})" paired? ] unit-test
{ f }
[ "[({]})" paired? ] unit-test

"paired and wrong nested brackets but innermost are correct" description
{ f } [ "[({}])" paired? ] unit-test
{ f }
[ "[({}])" paired? ] unit-test

"paired and incomplete brackets" description
{ f } [ "{}[" paired? ] unit-test
{ f }
[ "{}[" paired? ] unit-test

"too many closing brackets" description
{ f } [ "[]]" paired? ] unit-test
{ f }
[ "[]]" paired? ] unit-test

"early unexpected brackets" description
{ f } [ ")()" paired? ] unit-test
{ f }
[ ")()" paired? ] unit-test

"early mismatched brackets" description
{ f } [ "{)()" paired? ] unit-test
{ f }
[ "{)()" paired? ] unit-test

"math expression" description
{ t } [ "(((185 + 223.85) * 15) - 543)/2" paired? ] unit-test
{ t }
[ "(((185 + 223.85) * 15) - 543)/2" paired? ] unit-test

"complex latex expression" description
{ t } [ "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)" paired? ] unit-test
{ t }
[ "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)" paired? ] unit-test
2 changes: 1 addition & 1 deletion exercises/practice/pangram/.meta/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Pangram
function gen_test_case(case)
sentence = escape_factor(case["input"]["sentence"])
expected = case["expected"] ? "t" : "f"
return """{ $(expected) } [ "$(sentence)" pangram? ] unit-test"""
return """{ $(expected) }\n[ "$(sentence)" pangram? ] unit-test"""
end

end
30 changes: 20 additions & 10 deletions exercises/practice/pangram/pangram/pangram-tests.factor
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,43 @@ USING: exercism-tools io kernel pangram tools.test unicode ;
IN: pangram.tests

"empty sentence" description
{ f } [ "" pangram? ] unit-test
{ f }
[ "" pangram? ] unit-test

STOP-HERE

"perfect lower case" description
{ t } [ "abcdefghijklmnopqrstuvwxyz" pangram? ] unit-test
{ t }
[ "abcdefghijklmnopqrstuvwxyz" pangram? ] unit-test

"only lower case" description
{ t } [ "the quick brown fox jumps over the lazy dog" pangram? ] unit-test
{ t }
[ "the quick brown fox jumps over the lazy dog" pangram? ] unit-test

"missing the letter 'x'" description
{ f } [ "a quick movement of the enemy will jeopardize five gunboats" pangram? ] unit-test
{ f }
[ "a quick movement of the enemy will jeopardize five gunboats" pangram? ] unit-test

"missing the letter 'h'" description
{ f } [ "five boxing wizards jump quickly at it" pangram? ] unit-test
{ f }
[ "five boxing wizards jump quickly at it" pangram? ] unit-test

"with underscores" description
{ t } [ "the_quick_brown_fox_jumps_over_the_lazy_dog" pangram? ] unit-test
{ t }
[ "the_quick_brown_fox_jumps_over_the_lazy_dog" pangram? ] unit-test

"with numbers" description
{ t } [ "the 1 quick brown fox jumps over the 2 lazy dogs" pangram? ] unit-test
{ t }
[ "the 1 quick brown fox jumps over the 2 lazy dogs" pangram? ] unit-test

"missing letters replaced by numbers" description
{ f } [ "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog" pangram? ] unit-test
{ f }
[ "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog" pangram? ] unit-test

"mixed case and punctuation" description
{ t } [ "\"Five quacking Zephyrs jolt my wax bed.\"" pangram? ] unit-test
{ t }
[ "\"Five quacking Zephyrs jolt my wax bed.\"" pangram? ] unit-test

"a-m and A-M are 26 different characters but not a pangram" description
{ f } [ "abcdefghijklm ABCDEFGHIJKLM" pangram? ] unit-test
{ f }
[ "abcdefghijklm ABCDEFGHIJKLM" pangram? ] unit-test