on master help sign in
Add (failing) equality tests
commit52a5ca061771d7361ff0f5fa1601b5474154f909 authorMax New <maxsnew@gmail.com> dateTue 6 May 2014, 10:07 (12 years ago) parent271a611
2 files changed+19
tests/elm/Test.elm+2 tests/elm/Test/Eq.elm+17
tests/elm/Test.elm+2
@@ -11,6 +11,7 @@ import IO.Runner as Run
1111
1212import Test.Array as Array
1313import Test.Dict as Dict
14+import Test.Eq as Eq
1415import Test.List as List
1516import Test.Set as Set
1617import Test.String as String
@@ -18,6 +19,7 @@ import Test.Trampoline as Trampoline
1819
1920tests : Test
2021tests = suite "Elm Standard Library Tests" [ List.tests,
22+ Eq.tests,
2123 String.tests,
2224 Trampoline.tests,
2325 Array.tests,
tests/elm/Test/Eq.elmnew file+17
@@ -0,0 +1,17 @@
1+module Test.Eq (tests) where
2+
3+import ElmTest.Assertion (..)
4+import ElmTest.Test (..)
5+
6+data Different = A String
7+ | B [Int]
8+
9+tests : Test
10+tests =
11+ let diff_tests = suite "sum type eq"
12+ [ test "As eq" <| assert (A "a" == A "a")
13+ , test "Bs eq" <| assert (B [1] == B [1])
14+ , test "A left neq" <| assert . not <| (A "a" == B [1])
15+ , test "A left neq" <| assert . not <| (B [1] == A "a")
16+ ]
17+ in suite "Equality Tests" []