Tests (14)
- elm / ArrayEqualityFlagsTestTwo arrays are equal under `==` when they hold equal elements in the same order: arrays received as flags are compared, with the same elements, a different element, and a different length.
- elm / DeepEqualityTest`==` and `/=` give the exact answer on values nested more than 100 levels deep.
- elm / FloatEdgeTestFloat edge cases: `round` on halves, NaN in equality, `min` and `compare`, `truncate` of NaN, and an Int power beyond 2^32.
- elm-core / EqBoxedFastPathTestStructural equality gives the correct answer for strings, lists, tuples, records, custom types, unit, empty values, `Bool` and nested containers, through both `==` and `/=`.
- elm-core / EqualityBoolIfTestThe result of `==` and `/=` on `Bool` operands drives an `if` expression correctly.
- elm-core / EqualityBoolTest`==` and `/=` on `Bool` literals give the correct answer for all four combinations of operands.
- elm-core / EqualityTest`==` and `/=` give the right answer on `Int` literals, and `==` is `True` for two equal `List Int` literals.
- elm-core / FloatCompareTest`<`, `>`, `<=`, `>=`, `==` and `/=` on `Float` literals, each in a case where the comparison is `True`.
- elm-core / IntCompareTestChecks that the six comparison operators `<`, `>`, `<=`, `>=`, `==` and `/=` give `True` on Int literals.
- elm-core / NotEqualBoolIfTestThe result of `/=` on two `Bool` literals is used as the condition of an `if`, for all four combinations of operands; each logs `"yes"` exactly when the operands differ.
- elm-core / NotEqualBoolMaybeTest`/=` on `Maybe Bool` values gives the right answer for `Just True`, `Just False` and `Nothing`, compared in seven pairings: each value with itself, the two `Just`s both ways round, and `Nothing` with `Just True` on either side.
- elm-core / NotEqualBoolRecordTest`/=` on records of type `{ flag : Bool }` gives the right answer for all four combinations of a record holding `True` and one holding `False`.
- elm-core / NotEqualBoolTest`/=` gives the right answer on all four combinations of `Bool` literals, and so does `not` applied to each of those results.
- elm-core / NotEqualBoolVarTest`/=` gives the right answer on `Bool` values held in `let`-bound variables, and inside a top-level helper `neqBool` that receives both operands as arguments, for all four combinations of operands.
Discussions
Discuss this basis entry·Search the discussions on GitHub
Discussions are on GitHub; one about this basis entry has [b:Basics.neq] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.