Refactor test formatting for clarity and consistency across multiple exercises (#211)

This commit is contained in:
Erik Schierboom
2025-01-30 09:02:48 +01:00
committed by GitHub
parent ea6722bb3c
commit 24a8510945
6 changed files with 242 additions and 61 deletions

View File

@@ -3,18 +3,51 @@ needs exercism/test
with: test with: test
11 tests 11 tests
"Zero is an Armstrong number" ( 0 armstrong? ) true? "Zero is an Armstrong number"
( 0 armstrong? )
true?
SKIP-REST-OF-TESTS SKIP-REST-OF-TESTS
"Single digit numbers are Armstrong numbers" ( 5 armstrong? ) true?
"There are no 2 digit Armstrong Numbers" ( 10 armstrong? ) false? "Single digit numbers are Armstrong numbers"
"Three digit number that is not an Armstrong number" ( 100 armstrong? ) false? ( 5 armstrong? )
"Three digit number that is an Armstrong number" ( 153 armstrong? ) true? true?
"Four digit number that is an Armstrong number" ( 9474 armstrong? ) true?
"Four digit number that is not an Armstrong number" ( 9475 armstrong? ) false? "There are no 2 digit Armstrong Numbers"
"Seven digit number that is not an Armstrong number" ( 9926314 armstrong? ) false? ( 10 armstrong? )
"Seven digit number that is an Armstrong number" ( 9926315 armstrong? ) true? false?
"Armstrong number containing seven zeroes" ( 186709961001538790100634132976990 armstrong? ) true?
"The largest and last Armstrong number" ( 115132219018763992565095597973971522401 armstrong? ) true? "Three digit number that is not an Armstrong number"
( 100 armstrong? )
false?
"Three digit number that is an Armstrong number"
( 153 armstrong? )
true?
"Four digit number that is an Armstrong number"
( 9474 armstrong? )
true?
"Four digit number that is not an Armstrong number"
( 9475 armstrong? )
false?
"Seven digit number that is not an Armstrong number"
( 9926314 armstrong? )
false?
"Seven digit number that is an Armstrong number"
( 9926315 armstrong? )
true?
"Armstrong number containing seven zeroes"
( 186709961001538790100634132976990 armstrong? )
true?
"The largest and last Armstrong number"
( 115132219018763992565095597973971522401 armstrong? )
true?
end-of-tests end-of-tests
;with ;with

View File

@@ -3,7 +3,10 @@ needs exercism/test
with: test with: test
1 tests 1 tests
"hello world test" ( hello-world ) "Hello, World!" equal? "hello world test"
( hello-world )
"Hello, World!"
equal?
end-of-tests end-of-tests
;with ;with

View File

@@ -3,21 +3,63 @@ needs exercism/test
with: test with: test
14 tests 14 tests
"empty string" ( "" isogram? ) true? "empty string"
( "" isogram? )
true?
SKIP-REST-OF-TESTS SKIP-REST-OF-TESTS
"isogram with only lower case characters" ( "isogram" isogram? ) true?
"word with one duplicated character" ( "eleven" isogram? ) false? "isogram with only lower case characters"
"word with one duplicated character from the end of the alphabet" ( "zzyzx" isogram? ) false? ( "isogram" isogram? )
"longest reported english isogram" ( "subdermatoglyphic" isogram? ) true? true?
"word with duplicated character in mixed case" ( "Alphabet" isogram? ) false?
"word with duplicated character in mixed case, lowercase first" ( "alphAbet" isogram? ) false? "word with one duplicated character"
"hypothetical isogrammic word with hyphen" ( "thumbscrew-japingly" isogram? ) true? ( "eleven" isogram? )
"hypothetical word with duplicated character following hyphen" ( "thumbscrew-jappingly" isogram? ) false? false?
"isogram with duplicated hyphen" ( "six-year-old" isogram? ) true?
"made-up name that is an isogram" ( "Emily Jung Schwartzkopf" isogram? ) true? "word with one duplicated character from the end of the alphabet"
"duplicated character in the middle" ( "accentor" isogram? ) false? ( "zzyzx" isogram? )
"same first and last characters" ( "angola" isogram? ) false? false?
"word with duplicated character and with two hyphens" ( "up-to-date" isogram? ) false?
"longest reported english isogram"
( "subdermatoglyphic" isogram? )
true?
"word with duplicated character in mixed case"
( "Alphabet" isogram? )
false?
"word with duplicated character in mixed case, lowercase first"
( "alphAbet" isogram? )
false?
"hypothetical isogrammic word with hyphen"
( "thumbscrew-japingly" isogram? )
true?
"hypothetical word with duplicated character following hyphen"
( "thumbscrew-jappingly" isogram? )
false?
"isogram with duplicated hyphen"
( "six-year-old" isogram? )
true?
"made-up name that is an isogram"
( "Emily Jung Schwartzkopf" isogram? )
true?
"duplicated character in the middle"
( "accentor" isogram? )
false?
"same first and last characters"
( "angola" isogram? )
false?
"word with duplicated character and with two hyphens"
( "up-to-date" isogram? )
false?
end-of-tests end-of-tests
;with ;with

View File

@@ -3,16 +3,43 @@ needs exercism/test
with: test with: test
9 tests 9 tests
"year not divisible by 4 in common year" ( 2015 leap-year? ) false? "year not divisible by 4 in common year"
( 2015 leap-year? )
false?
SKIP-REST-OF-TESTS SKIP-REST-OF-TESTS
"year divisible by 100 but not by 3 is still not a leap year" ( 1900 leap-year? ) false?
"year divisible by 2, not divisible by 4 in common year" ( 1970 leap-year? ) false? "year divisible by 100 but not by 3 is still not a leap year"
"year divisible by 200, not divisible by 400 in common year" ( 1800 leap-year? ) false? ( 1900 leap-year? )
"year divisible by 100, not divisible by 400 in common year" ( 2100 leap-year? ) false? false?
"year divisible by 4 and 5 is still a leap year" ( 1960 leap-year? ) true?
"year divisible by 4, not divisible by 100 in leap year" ( 1996 leap-year? ) true? "year divisible by 2, not divisible by 4 in common year"
"year divisible by 400 is leap year" ( 2000 leap-year? ) true? ( 1970 leap-year? )
"year divisible by 400 but not by 125 is still a leap year" ( 2400 leap-year? ) true? false?
"year divisible by 200, not divisible by 400 in common year"
( 1800 leap-year? )
false?
"year divisible by 100, not divisible by 400 in common year"
( 2100 leap-year? )
false?
"year divisible by 4 and 5 is still a leap year"
( 1960 leap-year? )
true?
"year divisible by 4, not divisible by 100 in leap year"
( 1996 leap-year? )
true?
"year divisible by 400 is leap year"
( 2000 leap-year? )
true?
"year divisible by 400 but not by 125 is still a leap year"
( 2400 leap-year? )
true?
end-of-tests end-of-tests
;with ;with

View File

@@ -3,12 +3,27 @@ needs exercism/test
with: test with: test
4 tests 4 tests
"Black" ( "black" color-code ) 0 equal? "Black"
SKIP-REST-OF-TESTS ( "black" color-code )
"White" ( "white" color-code ) 9 equal? 0
"Orange" ( "orange" color-code ) 3 equal? equal?
"Colors" ( colors ) ["black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey", "white"] equal? SKIP-REST-OF-TESTS
"White"
( "white" color-code )
9
equal?
"Orange"
( "orange" color-code )
3
equal?
"Colors"
( colors )
["black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey", "white"]
equal?
end-of-tests end-of-tests
;with ;with

View File

@@ -3,30 +3,91 @@ needs exercism/test
with: test with: test
21 tests 21 tests
"invalid: 0 0 0" ( 0 0 0 equilateral? ) false? "invalid: 0 0 0"
( 0 0 0 equilateral? )
false?
SKIP-REST-OF-TESTS SKIP-REST-OF-TESTS
"equilateral with floating point" ( 0.5 0.5 0.5 equilateral? ) true?
"equilateral 2 2 2" ( 2 2 2 equilateral? ) true?
"isosceles is not equilateral" ( 2 3 2 equilateral? ) false?
"scalene is not equilateral" ( 5 4 6 equilateral? ) false?
"isosceles with floating point" ( 0.5 0.4 0.5 isosceles? ) true? "equilateral with floating point"
"(invalid) isosceles 1 1 3, 3 in last position" ( 1 1 3 isosceles? ) false? ( 0.5 0.5 0.5 equilateral? )
"(invalid) isosceles 1 3 1, 3 in middle position" ( 1 3 1 isosceles? ) false? true?
"(invalid) isosceles 3 1 1, 3 in first position" ( 3 1 1 isosceles? ) false?
"isosceles 2 2 3, 3 in last position" ( 2 2 3 isosceles? ) true?
"isosceles 2 3 2, 3 in middle position" ( 2 3 2 isosceles? ) true?
"isosceles 3 2 2, 3 in first position" ( 3 2 2 isosceles? ) true?
"is scalene and isosceles?" ( 2 3 4 isosceles? ) false?
"equlateral is also isosceles" ( 4 4 4 isosceles? ) true?
"scalene with floating point" ( 0.5 0.4 0.6 scalene? ) true? "equilateral 2 2 2"
"isosceles is not scalene" ( 4 4 3 scalene? ) false? ( 2 2 2 equilateral? )
"equilateral is not scalene" ( 4 4 4 scalene? ) false? true?
"scalene 5 4 6" ( 5 4 6 scalene? ) true?
"triangle inequality rule violation" ( 7 3 2 scalene? ) false? "isosceles is not equilateral"
"broken triangle #1" ( 0 3 3 scalene? ) false? ( 2 3 2 equilateral? )
"broken triangle #2" ( 0 3 0 scalene? ) false? false?
"scalene is not equilateral"
( 5 4 6 equilateral? )
false?
"isosceles with floating point"
( 0.5 0.4 0.5 isosceles? )
true?
"(invalid) isosceles 1 1 3, 3 in last position"
( 1 1 3 isosceles? )
false?
"(invalid) isosceles 1 3 1, 3 in middle position"
( 1 3 1 isosceles? )
false?
"(invalid) isosceles 3 1 1, 3 in first position"
( 3 1 1 isosceles? )
false?
"isosceles 2 2 3, 3 in last position"
( 2 2 3 isosceles? )
true?
"isosceles 2 3 2, 3 in middle position"
( 2 3 2 isosceles? )
true?
"isosceles 3 2 2, 3 in first position"
( 3 2 2 isosceles? )
true?
"is scalene and isosceles?"
( 2 3 4 isosceles? )
false?
"equlateral is also isosceles"
( 4 4 4 isosceles? )
true?
"scalene with floating point"
( 0.5 0.4 0.6 scalene? )
true?
"isosceles is not scalene"
( 4 4 3 scalene? )
false?
"equilateral is not scalene"
( 4 4 4 scalene? )
false?
"scalene 5 4 6"
( 5 4 6 scalene? )
true?
"triangle inequality rule violation"
( 7 3 2 scalene? )
false?
"broken triangle #1"
( 0 3 3 scalene? )
false?
"broken triangle #2"
( 0 3 0 scalene? )
false?
end-of-tests end-of-tests
;with ;with