From 7309d749a8508c9f5c2cc3aba5dca39734e40a88 Mon Sep 17 00:00:00 2001 From: Eric Willigers Date: Thu, 28 May 2026 18:27:38 +1000 Subject: [PATCH] reformat pangram tests [no important files changed] --- .../accumulate/accumulate/accumulate.factor | 2 +- .../all-your-base/all-your-base.factor | 2 +- .../matching-brackets/.meta/generator.jl | 2 +- .../matching-brackets-tests.factor | 60 ++++++++++++------- exercises/practice/pangram/.meta/generator.jl | 2 +- .../pangram/pangram/pangram-tests.factor | 30 ++++++---- 6 files changed, 64 insertions(+), 34 deletions(-) diff --git a/exercises/practice/accumulate/accumulate/accumulate.factor b/exercises/practice/accumulate/accumulate/accumulate.factor index 1ee6a4a..794c0a6 100644 --- a/exercises/practice/accumulate/accumulate/accumulate.factor +++ b/exercises/practice/accumulate/accumulate/accumulate.factor @@ -1,4 +1,4 @@ -USING: kernel ; +USING: kernel locals ; IN: accumulate :: accum ( seq quot: ( x -- y ) -- newseq ) diff --git a/exercises/practice/all-your-base/all-your-base/all-your-base.factor b/exercises/practice/all-your-base/all-your-base/all-your-base.factor index 31025d7..a258f31 100644 --- a/exercises/practice/all-your-base/all-your-base/all-your-base.factor +++ b/exercises/practice/all-your-base/all-your-base/all-your-base.factor @@ -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 ; diff --git a/exercises/practice/matching-brackets/.meta/generator.jl b/exercises/practice/matching-brackets/.meta/generator.jl index 9f5e936..400baf3 100644 --- a/exercises/practice/matching-brackets/.meta/generator.jl +++ b/exercises/practice/matching-brackets/.meta/generator.jl @@ -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 diff --git a/exercises/practice/matching-brackets/matching-brackets/matching-brackets-tests.factor b/exercises/practice/matching-brackets/matching-brackets/matching-brackets-tests.factor index 1343956..a36ca73 100644 --- a/exercises/practice/matching-brackets/matching-brackets/matching-brackets-tests.factor +++ b/exercises/practice/matching-brackets/matching-brackets/matching-brackets-tests.factor @@ -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 diff --git a/exercises/practice/pangram/.meta/generator.jl b/exercises/practice/pangram/.meta/generator.jl index bcad68e..a68f95f 100644 --- a/exercises/practice/pangram/.meta/generator.jl +++ b/exercises/practice/pangram/.meta/generator.jl @@ -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 diff --git a/exercises/practice/pangram/pangram/pangram-tests.factor b/exercises/practice/pangram/pangram/pangram-tests.factor index 00cba6d..28b0012 100644 --- a/exercises/practice/pangram/pangram/pangram-tests.factor +++ b/exercises/practice/pangram/pangram/pangram-tests.factor @@ -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