-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded tests for acronym and all-your-base exercises using not depr…
…ecated functionality.
- Loading branch information
1 parent
aa9547d
commit 702bfe7
Showing
4 changed files
with
296 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
[ | ||
{ | ||
"name": "acronym.test.basic", | ||
"test_code": "Test.expect (abbreviate \"Portable Network Graphics\" === \"PNG\")" | ||
"name": "basic", | ||
"test_code": "verify do\n labeled \"basic\" do\n expected = \"PNG\"\n actual = abbreviate \"Portable Network Graphics\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
}, | ||
{ | ||
"name": "acronym.test.lowercaseWords", | ||
"test_code": "Test.expect (abbreviate \"Ruby on Rails\" === \"ROR\")" | ||
"name": "lowercase words", | ||
"test_code": "verify do\n labeled \"lowercase words\" do\n expected = \"ROR\"\n actual = abbreviate \"Ruby on Rails\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
}, | ||
{ | ||
"name": "acronym.test.punctuation", | ||
"test_code": "Test.expect (abbreviate \"First In, First Out\" === \"FIFO\")" | ||
"name": "punctuation", | ||
"test_code": "verify do\n labeled \"punctuation\" do\n expected = \"FIFO\"\n actual = abbreviate \"First In, First Out\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
}, | ||
{ | ||
"name": "acronym.test.allCapsWord", | ||
"test_code": "Test.expect (abbreviate \"GNU Image Manipulation Program\" === \"GIMP\")" | ||
"name": "all caps word", | ||
"test_code": "verify do\n labeled \"all caps word\" do\n expected = \"GIMP\"\n actual = abbreviate \"GNU Image Manipulation Program\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
}, | ||
{ | ||
"name": "acronym.test.punctuationWithoutWhitespace", | ||
"test_code": "Test.expect (abbreviate \"Complementary metal-oxide semiconductor\" === \"CMOS\")" | ||
"name": "punctuation without whitespace", | ||
"test_code": "verify do\n labeled \"punctuation without whitespace\" do\n expected = \"CMOS\"\n actual = abbreviate \"Complementary metal-oxide semiconductor\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
}, | ||
{ | ||
"name": "acronym.test.veryLongAbbreviation", | ||
"test_code": "Test.expect (abbreviate \"Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me\" === \"ROTFLSHTMDCOALM\")" | ||
"name": "very long abbreviation", | ||
"test_code": "verify do\n labeled \"very long abbreviation\" do\n expected = \"ROTFLSHTMDCOALM\"\n actual = abbreviate \"Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
}, | ||
{ | ||
"name": "acronym.test.consecutiveDelimiters", | ||
"test_code": "Test.expect (abbreviate \"Something - I made up from thin air\" === \"SIMUFTA\")" | ||
"name": "consecutive delimiters", | ||
"test_code": "verify do\n labeled \"consecutive delimiters\" do\n expected = \"SIMUFTA\"\n actual = abbreviate \"Something - I made up from thin air\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
}, | ||
{ | ||
"name": "acronym.test.apostrophes", | ||
"test_code": "Test.expect (abbreviate \"Halley's Comet\" === \"HC\")" | ||
"name": "apostrophes", | ||
"test_code": "verify do\n labeled \"apostrophes\" do\n expected = \"HC\"\n actual = abbreviate \"Halley's Comet\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
}, | ||
{ | ||
"name": "acronym.test.underscoreEmphasis", | ||
"test_code": "Test.expect (abbreviate \"The Road _Not_ Taken\" === \"TRNT\")" | ||
"name": "underscore emphasis", | ||
"test_code": "verify do\n labeled \"underscore emphasis\" do\n expected = \"TRNT\"\n actual = abbreviate \"The Road _Not_ Taken\"\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual actual expected" | ||
} | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 21 additions & 21 deletions
42
exercises/practice/all-your-base/.meta/testAnnotation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,86 @@ | ||
[ | ||
{ | ||
"name": "single bit one to decimal", | ||
"test_code": "let\n Test.label.deprecated \"single bit one to decimal\" <| Test.expect (rebase +2 [+1] +10 === Some [+1])" | ||
"test_code": "verify do\n labeled \"single bit one to decimal\" do\n expected = Some [+1]\n actual = rebase +2 [+1] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "binary to single decimal", | ||
"test_code": "let\n Test.label.deprecated \"binary to single decimal\" <| Test.expect (rebase +2 [+1,+0,+1] +10 === Some [+5])" | ||
"test_code": "verify do\n labeled \"binary to single decimal\" do\n expected = Some [+5]\n actual = rebase +2 [+1,+0,+1] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "single decimal to binary", | ||
"test_code": "let\n Test.label.deprecated \"single decimal to binary\" <| Test.expect (rebase +10 [+5] +2 === Some [+1,+0,+1])" | ||
"test_code": "verify do\n labeled \"single decimal to binary\" do\n expected = Some [+1,+0,+1]\n actual = rebase +10 [+5] +2\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "binary to multiple decimal", | ||
"test_code": "let\n Test.label.deprecated \"binary to multiple decimal\" <| Test.expect (rebase +2 [+1,+0,+1,+0,+1,+0] +10 === Some [+4,+2])" | ||
"test_code": "verify do\n labeled \"binary to multiple decimal\" do\n expected = Some [+4,+2]\n actual = rebase +2 [+1,+0,+1,+0,+1,+0] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "decimal to binary", | ||
"test_code": "let\n Test.label.deprecated \"decimal to binary\" <| Test.expect (rebase +10 [+4,+2] +2 === Some [+1,+0,+1,+0,+1,+0])" | ||
"test_code": "verify do\n labeled \"decimal to binary\" do\n expected = Some [+1,+0,+1,+0,+1,+0]\n actual = rebase +10 [+4,+2] +2\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "trinary to hexadecimal", | ||
"test_code": "let\n Test.label.deprecated \"trinary to hexadecimal\" <| Test.expect (rebase +3 [+1,+1,+2,+0] +16 === Some [+2,+10])" | ||
"test_code": "verify do\n labeled \"trinary to hexadecimal\" do\n expected = Some [+2,+10]\n actual = rebase +3 [+1,+1,+2,+0] +16\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "hexadecimal to trinary", | ||
"test_code": "let\n Test.label.deprecated \"hexadecimal to trinary\" <| Test.expect (rebase +16 [+2,+10] +3 === Some [+1,+1,+2,+0])" | ||
"test_code": "verify do\n labeled \"hexadecimal to trinary\" do\n expected = Some [+1,+1,+2,+0]\n actual = rebase +16 [+2,+10] +3\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "15-bit integer", | ||
"test_code": "let\n Test.label.deprecated \"15-bit integer\" <| Test.expect (rebase +97 [+3,+46,+60] +73 === Some [+6,+10,+45])" | ||
"test_code": "verify do\n labeled \"15-bit integer\" do\n expected = Some [+6,+10,+45]\n actual = rebase +97 [+3,+46,+60] +73\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "empty list", | ||
"test_code": "let\n Test.label.deprecated \"empty list\" <| Test.expect (rebase +2 [] +10 === Some [+0])" | ||
"test_code": "verify do\n labeled \"empty list\" do\n expected = Some [+0]\n actual = rebase +2 [] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "single zero", | ||
"test_code": "let\n Test.label.deprecated \"single zero\" <| Test.expect (rebase +10 [+0] +2 === Some [+0])" | ||
"test_code": "verify do\n labeled \"single zero\" do\n expected = Some [+0]\n actual = rebase +10 [+0] +2\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "multiple zeros", | ||
"test_code": "let\n Test.label.deprecated \"multiple zeros\" <| Test.expect (rebase +10 [+0,+0,+0] +2 === Some [+0])" | ||
"test_code": "verify do\n labeled \"multiple zeros\" do\n expected = Some [+0]\n actual = rebase +10 [+0,+0,+0] +2\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "leading zeros", | ||
"test_code": "let\n Test.label.deprecated \"leading zeros\" <| Test.expect (rebase +7 [+0,+6,+0] +10 === Some [+4,+2])" | ||
"test_code": "verify do\n labeled \"leading zeros\" do\n expected = Some [+4,+2]\n actual = rebase +7 [+0,+6,+0] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "input base is one", | ||
"test_code": "let\n Test.label.deprecated \"input base is one\" <| Test.expect (rebase +1 [+0] +10 === None)" | ||
"test_code": "verify do\n labeled \"input base is one\" do\n expected = None\n actual = rebase +1 [+0] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "input base is zero", | ||
"test_code": "let\n Test.label.deprecated \"input base is zero\" <| Test.expect (rebase +0 [] +10 === None)" | ||
"test_code": "verify do\n labeled \"input base is zero\" do\n expected = None\n actual = rebase +0 [] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "input base is negative", | ||
"test_code": "let\n Test.label.deprecated \"input base is negative\" <| Test.expect (rebase -2 [+1] +10 === None)" | ||
"test_code": "verify do\n labeled \"input base is negative\" do\n expected = None\n actual = rebase -2 [+1] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "negative digit", | ||
"test_code": "let\n Test.label.deprecated \"negative digit\" <| Test.expect (rebase +2 [+1,-1,+1,+0,+1,+0] +10 === None)" | ||
"test_code": "verify do\n labeled \"negative digit\" do\n expected = None\n actual = rebase +2 [+1,-1,+1,+0,+1,+0] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "invalid positive digit", | ||
"test_code": "let\n Test.label.deprecated \"invalid positive digit\" <| Test.expect (rebase +2 [+1,+2,+1,+0,+1,+0] +10 === None)" | ||
"test_code": "verify do\n labeled \"invalid positive digit\" do\n expected = None\n actual = rebase +2 [+1,+2,+1,+0,+1,+0] +10\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "output base is one", | ||
"test_code": "let\n Test.label.deprecated \"output base is one\" <| Test.expect (rebase +2 [+1,+0,+1,+0,+1,+0] +1 === None)" | ||
"test_code": "verify do\n labeled \"output base is one\" do\n expected = None\n actual = rebase +2 [+1,+0,+1,+0,+1,+0] +1\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "output base is zero", | ||
"test_code": "let\n Test.label.deprecated \"output base is zero\" <| Test.expect (rebase +10 [+7] +0 === None)" | ||
"test_code": "verify do\n labeled \"output base is zero\" do\n expected = None\n actual = rebase +10 [+7] +0\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "output base is negative", | ||
"test_code": "let\n Test.label.deprecated \"output base is negative\" <| Test.expect (rebase +2 [+1] -7 === None)" | ||
"test_code": "verify do\n labeled \"output base is negative\" do\n expected = None\n actual = rebase +2 [+1] -7\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
}, | ||
{ | ||
"name": "both bases are negative", | ||
"test_code": "let\n Test.label.deprecated \"both bases are negative\" <| Test.expect (rebase -2 [+1] -7 === None)" | ||
"test_code": "verify do\n labeled \"both bases are negative\" do\n expected = None\n actual = rebase -2 [+1] -7\n label \"expected\" expected\n label \"actual\" actual\n ensureEqual expected actual" | ||
} | ||
] |
Oops, something went wrong.