-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove bad makefile target gha (#199)
* Updated workflow 'ci' and deleted 'ci-pull-request' * Deleted makefile target 'gha' and its companion 'debug'. * Fix failing test for exercise 'binary' (applied './bin/generate --test-only binary')
- Loading branch information
Showing
4 changed files
with
23 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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,57 +1,55 @@ | ||
(* version 1.0.0 *) | ||
|
||
use "testlib.sml"; | ||
use "example.sml"; | ||
use "binary.sml"; | ||
|
||
infixr |> | ||
fun x |> f = f x | ||
|
||
val testsuite = | ||
describe "binary" [ | ||
test "binary 0 is decimal 0" | ||
(fn _ => decimal ("0") |> Expect.equalTo (SOME 0)), | ||
(fn _ => decimal "0" |> Expect.equalTo (SOME 0)), | ||
|
||
test "binary 1 is decimal 1" | ||
(fn _ => decimal ("1") |> Expect.equalTo (SOME 1)), | ||
(fn _ => decimal "1" |> Expect.equalTo (SOME 1)), | ||
|
||
test "binary 10 is decimal 2" | ||
(fn _ => decimal ("10") |> Expect.equalTo (SOME 2)), | ||
(fn _ => decimal "10" |> Expect.equalTo (SOME 2)), | ||
|
||
test "binary 11 is decimal 3" | ||
(fn _ => decimal ("11") |> Expect.equalTo (SOME 3)), | ||
(fn _ => decimal "11" |> Expect.equalTo (SOME 3)), | ||
|
||
test "binary 100 is decimal 4" | ||
(fn _ => decimal ("100") |> Expect.equalTo (SOME 4)), | ||
(fn _ => decimal "100" |> Expect.equalTo (SOME 4)), | ||
|
||
test "binary 1001 is decimal 9" | ||
(fn _ => decimal ("1001") |> Expect.equalTo (SOME 9)), | ||
(fn _ => decimal "1001" |> Expect.equalTo (SOME 9)), | ||
|
||
test "binary 11010 is decimal 26" | ||
(fn _ => decimal ("11010") |> Expect.equalTo (SOME 26)), | ||
(fn _ => decimal "11010" |> Expect.equalTo (SOME 26)), | ||
|
||
test "binary 10001101000 is decimal 1128" | ||
(fn _ => decimal ("10001101000") |> Expect.equalTo (SOME 1128)), | ||
(fn _ => decimal "10001101000" |> Expect.equalTo (SOME 1128)), | ||
|
||
test "binary ignores leading zeros" | ||
(fn _ => decimal ("000011111") |> Expect.equalTo (SOME 31)), | ||
(fn _ => decimal "000011111" |> Expect.equalTo (SOME 31)), | ||
|
||
test "2 is not a valid binary digit" | ||
(fn _ => decimal ("2") |> Expect.equalTo NONE), | ||
(fn _ => decimal "2" |> Expect.equalTo NONE), | ||
|
||
test "a number containing a non-binary digit is invalid" | ||
(fn _ => decimal ("01201") |> Expect.equalTo NONE), | ||
(fn _ => decimal "01201" |> Expect.equalTo NONE), | ||
|
||
test "a number with trailing non-binary characters is invalid" | ||
(fn _ => decimal ("10nope") |> Expect.equalTo NONE), | ||
(fn _ => decimal "10nope" |> Expect.equalTo NONE), | ||
|
||
test "a number with leading non-binary characters is invalid" | ||
(fn _ => decimal ("nope10") |> Expect.equalTo NONE), | ||
(fn _ => decimal "nope10" |> Expect.equalTo NONE), | ||
|
||
test "a number with internal non-binary characters is invalid" | ||
(fn _ => decimal ("10nope10") |> Expect.equalTo NONE), | ||
(fn _ => decimal "10nope10" |> Expect.equalTo NONE), | ||
|
||
test "a number and a word whitespace spearated is invalid" | ||
(fn _ => decimal ("001 nope") |> Expect.equalTo NONE) | ||
test "a number and a word whitespace separated is invalid" | ||
(fn _ => decimal "001 nope" |> Expect.equalTo NONE) | ||
] | ||
|
||
val _ = Test.run testsuite |