Elm Exactly
Results /

elm-core

elm/core, the basis library: arithmetic, equality and order, and every module, function by function

Discussions of this project and its tests โ†“

Showing 370 of 370 tests. Hover over a badge for the reason.

Testelm-0.19.1elm-0.19.2elm-0.19.3lamdera-1.5.0
AppendSliceLengthTest
`++` of long strings and of slices, observed with `String.length` and `String.slice`.
passpasspasspass
ArrayAppendRepeatedTest
Growing an `Array` by 100 successive `Array.append` calls, three elements at a time, keeps every element in order.
passpasspasspass
ArrayFoldlFloatSumTest
`Array.foldl (+) 0.0` sums an `Array Float` of 1.5, 2.5 and 3.0 to exactly 7.0.
passpasspasspass
ArrayFoldrFloatSumTest
`Array.foldr (+) 0.0` sums an `Array Float` of 1.5, 2.5 and 3.0 to exactly 7.0.
passpasspasspass
ArrayIndexedMapFloatAddIndexTest
`Array.indexedMap` over an `Array Float` passes each element's index, here added to the element to turn `[ 10, 20, 30 ]` into `[ 10, 21, 32 ]`.
passpasspasspass
ArrayMapDebugLogKindTest
`Array.map` and `Array.initialize` with a point-free `Debug.log` as the function give an `Array Int` that later Array operations read correctly.
passpasspasspass
ArrayMapFloatIncrementTest
`Array.map ((+) 0.5)` over an `Array Float` of 1.5 and 2.5 gives exactly 2.0 and 3.0.
passpasspasspass
ArrayUnsafeGetCharElementTest
`Array.get 1` on an `Array Char` of `'x'` and `'y'` returns `Just 'y'`.
passpasspasspass
ArrayUnsafeGetFloatElementTest
`Array.get 0` on an `Array Float` of 1.5 and 2.5 returns `Just 1.5`.
passpasspasspass
ArrayUnsafeSetCharOverwriteTest
`Array.set 0 'b'` on a one-element `Array Char` holding `'a'` replaces it, so `Array.get 0` then returns `Just 'b'`.
passpasspasspass
BasicsClampTestelm-spec
`clamp 5 10` returns the lower bound for 3, the value itself for 7 and the upper bound for 15, and `clamp 1.0 5.0` leaves 3.5 unchanged.
passpasspasspass
BasicsIdentityTestelm-spec
`identity` returns its argument unchanged for an Int and a String, and `always 99` returns 99 whatever its second argument.
passpasspasspass
BasicsIsNaNTestelm-spec
`isNaN` is true for `0 / 0` and false for 42.0, and `isInfinite` is true for `1 / 0` and false for 42.0.
passpasspasspass
BasicsModByTestelm-spec
`modBy 3` gives 1 for 7, 0 for 9, and 2 for -1: the result takes the sign of the modulus, not of the dividend.
passpasspasspass
BitwiseAndTest
`Bitwise.and` returns the bits two `Int`s have in common.
passpasspasspass
BitwiseComplementTest
`Bitwise.complement` flips every bit, so the complement of `n` is `-n - 1`.
passpasspasspass
BitwiseIdentityTest
`Bitwise.and` and `Bitwise.or` of a number with itself return the number, and `Bitwise.xor` of a number with itself returns 0.
passpasspasspass
BitwiseOrTest
`Bitwise.or` returns the bits set in either of two `Int`s.
passpasspasspass
BitwiseShiftLeftTest
`Bitwise.shiftLeftBy n x` shifts the bits of `x` left by `n` places, multiplying it by 2 to the power `n`.
passpasspasspass
BitwiseShiftRightTest
`Bitwise.shiftRightBy` is an arithmetic shift: it divides a positive number by a power of two, and keeps the sign of a negative one, so `-1` shifted right stays `-1`.
passpasspasspass
BitwiseShiftRightZfTest
`Bitwise.shiftRightZfBy` shifts a positive Int right, filling with zeros: 16 shifted by 4 is 1 and by 1 is 8.
passpasspasspass
BitwiseXorTest
`Bitwise.xor` gives the bitwise exclusive or of two Ints: 15 xor 8 is 7, 15 xor 16 is 31, and 15 xor 15 is 0.
passpasspasspass
BoolNotTestelm-spec
`not` negates a Bool: `not True` is `False` and `not False` is `True`.
passpasspasspass
BoolXorTestelm-spec
The Basics `xor` function gives `True` exactly when its two Bool arguments differ, checked over all four combinations.
passpasspasspass
CeilingToIntTestelm-spec
`ceiling` rounds a `Float` up to an `Int`: `ceiling 2.3` is 3 and `ceiling -2.7` is -2.
passpasspasspass
CharAstralArrayTest
An astral `Char`, one whose code point is above 0xFFFF and so lies outside the Basic Multilingual Plane, keeps its code point when stored in an `Array`.
passpasspasspass
CharAstralCodeTestelm-spec
`Char.fromCode` and `Char.toCode` round-trip Unicode code points, including astral ones (above 0xFFFF) and the largest, 0x10FFFF.
passpasspasspass
CharAstralDebugLogTest
`Debug.log` prints an astral `Char` (code point above 0xFFFF) as the character itself in single quotes, whether written as a literal, made with `Char.fromCode`, or inside `Just`, and prints a non-ASCII character below 0โ€ฆ
passpasspasspass
CharAstralListHeadTest
An astral `Char` (code point above 0xFFFF) held in a list keeps its code point when read through `List.head`, a cons pattern and `List.map`, and `Debug.log` prints the list with the characters themselves.
passpasspasspass
CharCaseFullRangeTest
`Char` and `String` case mapping over every code point of every Unicode plane, reduced to one hash per plane so that any difference shows which plane it is in.
passpasspasspass
CharCaseOrdinaryTest
`Char.toUpper` and `Char.toLower` of characters whose upper and lower case are each a single code point, across several scripts.
passpasspasspass
CharCaseSpecialTest
`Char.toUpper` and `Char.toLower` of U+1E9E (capital sharp s): the upper case is the character itself and the lower case is U+00DF.
passpasspasspass
CharFromCodeLoneSurrogatePatternTest
A lone low surrogate made by `Char.fromCode`, `Char.fromCode 0xDE00`, does not match the pattern `'\u{1F600}'`, of which it is the second UTF-16 code unit; the character `Char.fromCode 0x1F600` does.
passpasspasspass
CharFromCodeTestelm-spec
`Char.fromCode` turns the code points 65, 97 and 48 into `'A'`, `'a'` and `'0'`.
passpasspasspass
CharFromCodeWideIntTest
`Char.fromCode` of a code outside 0 to 0x10FFFF gives the replacement character U+FFFD (65533), even when the code's low 32 bits are a valid code point.
passpasspasspass
CharGetCharWidthTest
A width function comparing `Char.toCode` against `0xFFFF` gives 1 for an ASCII character taken from a string with `String.uncons`.
passpasspasspass
CharIsAlphaTest
`Char.isAlpha` is `True` for `'a'` and `'Z'` and `False` for `'0'` and a space.
passpasspasspass
CharIsDigitTest
`Char.isDigit` is `True` for `'0'` and `'9'` and `False` for `'a'` and `'A'`.
passpasspasspass
CharLocaleCaseTest
`Char.toLocaleUpper` and `Char.toLocaleLower` of six characters with no locale-specific case rules give the same results as `Char.toUpper` and `Char.toLower`.
passpasspasspass
CharToCodeFoldStringTest
`String.foldl` hands each character of a string to a function that sums their `Char.toCode` values.
passpasspasspass
CharToCodeFromStringTest
`Char.toCode` of a character obtained at run time from `String.uncons`, rather than written as a literal, gives that character's code point.
passpasspasspass
CharToCodeTestelm-spec
`Char.toCode` gives the code points 65, 97 and 48 for `'A'`, `'a'` and `'0'`.
passpasspasspass
CharToCodeThroughFunctionTestelm-spec
`Char.toCode` of a character returned from a top-level function, here an identity function applied to `'A'`, gives 65.
passpasspasspass
CharToLowerTest
`Char.toLower` maps `'A'` to `'a'` and `'Z'` to `'z'`, and leaves `'0'` unchanged.
passpasspasspass
CharToUpperTest
`Char.toUpper` maps `'a'` to `'A'` and `'z'` to `'Z'`, and leaves `'0'` unchanged.
passpasspasspass
CharUnconsPatternTest
A Char taken from a String by `String.uncons` matches the Char literal pattern `'"'`, and is `==` to the literal.
passpasspasspass
CmdBatchOrderTestelm-unspecced
The order in which an effect manager receives the commands of a `Cmd.batch`: last first, for both a port and `Task.perform`.
passpasspasspass
CmdMapComposeTestelm-spec
`Cmd.map` applies its functions to a command's message, the innermost first.
passpasspasspass
ComparableMinMaxTestelm-spec
`min` and `max` on `String` and `Char`, which order them by character code.
passpasspasspass
CompareCharCaptureTestelm-spec
A local insertion sort, `sortWith`, on a list of `Char`, given `compare` itself and given a lambda that calls `compare` with its arguments swapped.
passpasspasspass
CompareCharTestelm-spec
`compare` on `Char` returns `LT`, `GT` or `EQ` by character code.
passpasspasspass
CompareCustomWithEmptyListFieldTestelm-spec
Ordering and equality of a custom type whose `List Int` field may be empty.
passpasspasspass
CompareEmptyListTestelm-spec
`compare` on `List Int` values, including the empty list.
passpasspasspass
CompareEmptyStringTestelm-spec
`compare` on `String` values, including the empty string.
passpasspasspass
CompareFloatCaptureTestelm-spec
`compare` on `Float` passed as a function value to a local insertion sort, `sortWith`.
passpasspasspass
CompareFloatTestelm-spec
`compare` on `Float` returns `LT`, `GT` and `EQ` for less, greater and equal operands.
passpasspasspass
CompareIntCaptureTestelm-spec
`compare` on `Int` passed as a function value to a local insertion sort, `sortWith`.
passpasspasspass
CompareIntTestelm-spec
`compare` on `Int` returns `LT`, `GT` and `EQ` for less, greater and equal operands.
passpasspasspass
CompareNestedEmptyListTestelm-spec
`compare` on `List (List Int)` values where some inner lists are empty.
passpasspasspass
CompareRecordWithEmptyListFieldTestelm-spec
Ordering and equality of a record whose `List Int` field may be empty.
passpasspasspass
CompareStringTestelm-spec
`compare` on `String` returns `LT`, `GT` and `EQ` for strings that are less than, greater than and equal to one another, comparing character codes from the first character.
passpasspasspass
CompareTupleWithEmptyListNestedTestelm-spec
`compare` on tuples nested two deep whose `List Int` field may be empty.
passpasspasspass
CompareTupleWithEmptyListTestelm-spec
`compare` on pairs whose `List Int` field may be empty.
passpasspasspass
CompareTupleWithEmptyStringTestelm-spec
`compare` on pairs whose `String` field may be empty.
passpasspasspass
CompilerIssue2362NanTupleEqualityTestelm19-bugelm-spec
A tuple holding NaN is not equal to anything, including itself.
failfailfailfail
CompositionTestelm-spec
Function composition with `>>` and `<<`, and the pipe operator `|>`.
passpasspasspass
ContainerCompareCharTestelm-spec
Ordering of pairs, triples and lists of `Char` with `compare` and the relational operators.
passpasspasspass
ContainerCompareIntTestelm-spec
Ordering of pairs, triples and lists of `Int` with `compare` and the relational operators.
passpasspasspass
ContainerEqualityCharTestelm-spec
Checks `==` on pairs, triples and lists of `Char`.
passpasspasspass
ContainerEqualityCustomFloatTestelm-spec
Checks `==` on custom-type values whose fields are `Float`, including NaN, infinities and negative zero.
passpasspasspass
ContainerEqualityFloatTestelm-spec
Checks `==` on pairs, triples and lists of `Float`, including NaN, infinities and negative zero.
passpasspasspass
ContainerEqualityIntTestelm-spec
Checks `==` on pairs, triples and lists of `Int`.
passpasspasspass
ContainerEqualityRecordFloatTestelm-spec
Checks `==` on records whose fields are `Float`, including NaN, infinities and negative zero.
passpasspasspass
ContainerEqualityStringTestelm-spec
Checks `==` on pairs, triples and lists of `String`.
passpasspasspass
ControlFlowBooleanWithNotTestelm-spec
Checks `not` applied to a comparison: `not (n > 0)` for `n = -5` is `True`.
passpasspasspass
CoreIssue1001CharToUpperSharpSTestelm19-bug
`Char.toUpper 'รŸ'` returns a single character.
failfailfailfail
CoreIssue1019StringWordsEmptyTestelm19-bug
`String.words` of a string with no words returns `[]`.
failfailfailfail
CoreIssue1048LogBaseTenTestelm19-bug
`logBase 10 1000` is exactly 3.
failfailfailfail
CoreIssue1050NanGreaterThanNanTestelm19-bugelm-spec
`NaN > NaN` and `NaN >= NaN` are False.
failfailfailfail
CoreIssue1060StringToListLoneSurrogateTestelm19-bug
`String.toList` of a string holding a lone low surrogate returns one `Char`.
failfailfailfail
CoreIssue1080ClampNanTestelm19-bugelm-spec
`clamp -100 100` of NaN returns NaN.
failfailfailfail
CoreIssue1110PortDeclarationOrderTestelm19-bugelm-spec
A subscription returned together with a port command is active in time to receive that command's synchronous reply.
failfailfailfail
CoreIssue1115NanEqualsLiteralZeroTestelm19-bugelm-spec
NaN compared with a literal `0` is not equal, on either side of `==`.
failfailfailfail
CoreIssue1123NestedCmdBatchStackOverflowTestelm19-bugelm-unspecced
A deeply nested `Cmd.batch` overflows the stack in `_Platform_gatherEffects`.
failfailfailfail
CoreIssue1142StringToIntMaxSafeTestelm19-bug
`String.toInt` is off by one for integers near 2^53.
failfailfailfail
CoreIssue1150CharToCodeLoneSurrogateTestelm19-bugelm-spec
`Char.toCode` returns NaN, typed as `Int`, for a lone surrogate.
failfailfailfail
CoreIssue1154PortSubscribedWithCmdTestelm19-bugelm-spec
A port subscription added by the same `update` that sends a command to an outgoing port misses the outgoing port's synchronous reply, depending on the order of the ports in the generated code.
failfailfailfail
CoreIssue955KillProcessTwiceTestelm19-bugelm-spec
Killing a process that has already finished, a second time, throws a JavaScript error.
failfailfailfail
CoreIssue960PowNegativeExponentIntTestelm19-bugelm-spec
`(^)` on two `Int`s with a negative exponent returns a fraction typed as `Int`.
failfailfailfail
CoreIssue988NanEqualityReferenceTestelm19-bugelm-spec
Structural equality of values containing NaN depends on reference identity.
failfailfailfail
DebugInternalsTest
`Debug.toString` prints an `Html` node or a `Json.Encode.Value` as `<internals>`.
passpasspasspass
DebugToStringAsValueTest
`Debug.toString` passed as a function value to `List.map` works on lists of `Float`s, of number literals and of `String`s in the same program.
passpasspasspass
DebugToStringFormatsTest
`Debug.toString` prints every kind of Elm value in the same format as Elm's own printer.
passpassfailfail
DebugToStringTest
`Debug.toString` renders an Int, a Float, a Bool, a String (with its quotes), a list, a tuple, `Just 5` and `Nothing` as their Elm source text.
passpasspasspass
DictDeepEqualityTest
`==` gives the exact answer on two Dicts whose values under one key differ 150 levels down.
passpasspasspass
DictDiffFoldlStringKeysTest
`Dict.diff` between two `String`-keyed dicts, followed by `Dict.foldl` over the result, keeps exactly the keys missing from the second dict.
passpasspasspass
DictFromListToListRoundtripTest
`Dict.fromList (Dict.toList d)` is equal under `==` to `d`, and two dicts holding the same entries are equal, whatever order the entries were inserted in.
passpasspasspass
DictRemoveMinimalTest
`Dict.remove` deletes the smaller of two keys from a two-entry `Dict Int Int`, leaving a dictionary of size 1.
passpasspasspass
DictTupleListKeyTest
A `Dict` keyed by `( Int, List Int )` orders a key with an empty list before keys with non-empty lists, and can look that key up.
passpasspasspass
DictUnionDiffIterTest
`Dict.union` and `Dict.diff` on two disjoint `Dict Int Int` values give the expected sizes when repeated 50 times.
passpasspasspass
EmbeddedConstantsInListTest
`List.filterMap identity` on a list mixing `Nothing` and `Just` values keeps the `Just` payloads in order.
passpasspasspass
EmbeddedNilFoldTest
`List.map List.length` over a list of lists, two of them empty, gives 0 for each empty list.
passpasspasspass
EmbeddedNothingAndThenTest
`Nothing` propagates through a chain of `Maybe.andThen` calls, whether it starts the chain or is returned partway along it.
passpasspasspass
EmbeddedResultErrOkTest
`Result.andThen` passes an `Ok` value to its callback, passes an `Err` through untouched, and stops at the first callback that returns `Err`.
passpasspasspass
EmbeddedReturnEmptyStringTest
`String.uncons` returns `Just` the first character and the rest of a non-empty string, and `Nothing` for the empty string.
passpasspasspass
EqBoxedFastPathTestelm-spec
Structural equality gives the correct answer for strings, lists, tuples, records, custom types, unit, empty values, `Bool` and nested containers, through both `==` and `/=`.
passpasspasspass
EqualityBoolCaseTestelm-spec
The result of `==` on `Bool` operands drives a `case` on `True` and `False` correctly.
passpasspasspass
EqualityBoolContainerTestelm-spec
Structural equality compares `Bool` elements inside tuples and lists correctly.
passpasspasspass
EqualityBoolIfTestelm-spec
The result of `==` and `/=` on `Bool` operands drives an `if` expression correctly.
passpasspasspass
EqualityBoolListMemberTest
`List.member` finds `Bool` values in a list correctly.
passpasspasspass
EqualityBoolMaybeTestelm-spec
Equality on `Maybe Bool` compares the wrapped `Bool` values and tells `Nothing` apart from `Just`.
passpasspasspass
EqualityBoolPapTestelm-spec
`(==)` partially applied to a `Bool` works as an ordinary predicate passed to the local helpers `map`, `filter` and `any`, written with patterns.
passpasspasspass
EqualityBoolRecordTestelm-spec
Record equality compares `Bool` fields correctly.
passpasspasspass
EqualityBoolTestelm-spec
`==` and `/=` on `Bool` literals give the correct answer for all four combinations of operands.
passpasspasspass
EqualityBoolVarTestelm-spec
`==` on `Bool` values gives the correct answer when the operands are variables or arguments rather than literals.
passpasspasspass
EqualityFloatViaSetTest
`List.member` finds `Float` values in a list correctly.
passpasspasspass
EqualityOtherConstantsTestelm-spec
`==` on empty and non-empty values of `String`, `List Int`, `Maybe Int` and `()` gives the right answer in both argument orders.
passpasspasspass
EqualityTestelm-spec
`==` and `/=` give the right answer on `Int` literals, and `==` is `True` for two equal `List Int` literals.
passpasspasspass
FloatAbsTestelm-spec
`abs` on a positive, a negative and a zero `Float`.
passpasspasspass
FloatAddTestelm-spec
`+` on `Float` literals, including negative operands and a sum of zero.
passpasspasspass
FloatCeilingTestelm-spec
`ceiling` rounds a `Float` up towards positive infinity, for positive, whole and negative values.
passpasspasspass
FloatCompareTestelm-spec
`<`, `>`, `<=`, `>=`, `==` and `/=` on `Float` literals, each in a case where the comparison is `True`.
passpasspasspass
FloatDivTestelm-spec
`/` on `Float` values for each combination of signs of the dividend and divisor.
passpasspasspass
FloatFloorTestelm-spec
`floor` rounds a `Float` down towards negative infinity, for positive, whole and negative values.
passpasspasspass
FloatInfinityTestelm-spec
`isInfinite` is True for positive and negative infinity and False for a finite Float.
passpasspasspass
FloatMathAcosTestelm-spec
`acos 1` is 0.
passpasspasspass
FloatMathAsinTestelm-spec
`asin 0` is 0.
passpasspasspass
FloatMathAtan2Testelm-spec
`atan2 1 1` is pi/4, printed as 0.7853981633974483.
passpasspasspass
FloatMathAtanTestelm-spec
`atan 0` is 0.
passpasspasspass
FloatMathBasicsETestelm-spec
`Basics.e` prints as 2.718281828459045.
passpasspasspass
FloatMathFloatLessThanTestelm-spec
`<` on two Float literals, `1.5 < 2.5`, is True.
passpasspasspass
FloatMathIsNaNTestelm-spec
`isNaN (0 / 0)` is True.
passpasspasspass
FloatMathSin2PlusCos21Testelm-spec
`sin 1 * sin 1 + cos 1 * cos 1` prints as exactly 1.
passpasspasspass
FloatMathTanTestelm-spec
`tan 0` is 0.
passpasspasspass
FloatMinMaxTestelm-spec
`min` and `max` on Floats pick the smaller and larger argument, including with a negative argument.
passpasspasspass
FloatMulTestelm-spec
Float multiplication gives the expected sign and value for positive, mixed-sign, two negative and zero operands.
passpasspasspass
FloatNaNTestelm-spec
`isNaN` is True for `0.0 / 0.0` and False for 3.14, and NaN plus 1.0 is NaN: the book's `add` gives NaN when either argument is NaN.
passpasspasspass
FloatNegateTestelm-spec
`negate` flips the sign of a positive and a negative Float, and `negate 0.0` prints as 0.
passpasspasspass
FloatNegativeZeroTestelm-spec
Negative zero (`-0.0`) equals 0.0, and dividing 1.0 by it gives -Infinity while dividing by 0.0 gives Infinity.
passpasspasspass
FloatPowTestelm-spec
`^` on Floats computes powers with positive, zero and negative exponents.
passpasspasspass
FloatRoundTestelm-spec
`round` rounds a Float to the nearest Int, with halves rounded up: 2.5 gives 3 and 3.5 gives 4.
passpasspasspass
FloatSqrtTestelm-spec
`sqrt` of 4.0, 9.0 and 0.0 is 2, 3 and 0.
passpasspasspass
FloatSubTestelm-spec
Float subtraction gives the expected value, including when the right operand is a negative literal.
passpasspasspass
FloatTruncateTestelm-spec
`truncate` rounds a Float toward zero: 2.7 and 2.3 give 2, and -2.3 and -2.7 give -2.
passpasspasspass
FloorToIntTestelm-spec
`floor` rounds a Float down to an Int: 2.7 gives 2 and -2.3 gives -3.
passpasspasspass
FromArrayCharListCompareSortTest
`List.sort` orders a `List Char` that came out of an `Array` via `Array.fromList` and `Array.toList`.
passpasspasspass
FromArrayCharListEqualityTest
Converting a `List Char` to an `Array` with `Array.fromList` and back with `Array.toList` gives a list equal to the original.
passpasspasspass
FromArrayCharListMapTest
`List.map Char.toUpper` works on a `List Char` taken out of an `Array` with `Array.toList`.
passpasspasspass
FromArrayCharListRoundtripTest
Converting `['a', 'b', 'c']` to an `Array` with `Array.fromList` and back with `Array.toList` gives the same list.
passpasspasspass
FromArrayFloatListCompareSortTest
`List.sort` orders a `List Float` that came out of an `Array` via `Array.fromList` and `Array.toList`.
passpasspasspass
FromArrayFloatListEqualityTest
Converting a `List Float` to an `Array` with `Array.fromList` and back with `Array.toList` gives a list equal to the original.
passpasspasspass
FromArrayFloatListMapTest
Floating-point arithmetic in `List.map` works on a `List Float` taken out of an `Array` with `Array.toList`.
passpasspasspass
FromArrayFloatListRoundtripTest
Converting `[1.5, 2.5, 3.5]` to an `Array` with `Array.fromList` and back with `Array.toList` gives the same list.
passpasspasspass
IntAbsTestelm-spec
`abs` on an Int returns its magnitude for a positive, a negative and a zero argument.
passpasspasspass
IntAddTestelm-spec
Int addition gives the right sum for two positives, a positive and its negation, and two negatives.
passpasspasspass
IntCompareTestelm-spec
Checks that the six comparison operators `<`, `>`, `<=`, `>=`, `==` and `/=` give `True` on Int literals.
passpasspasspass
IntDivByZeroTestelm-spec
Checks that integer division `//` by zero gives 0, for a positive and for a negative dividend.
passpasspasspass
IntDivTestelm-spec
Checks that integer division `//` truncates toward zero for all four sign combinations of dividend and divisor.
passpasspasspass
IntMinMaxTestelm-spec
Checks `min` and `max` on Int arguments, including a negative one.
passpasspasspass
IntModByTestelm-spec
Checks that `modBy` with a positive modulus gives a non-negative result for a positive, a negative and a zero dividend.
passpasspasspass
IntMulTestelm-spec
Checks integer multiplication `*` with positive, mixed-sign, two negative and zero operands.
passpasspasspass
IntNegateTestelm-spec
Checks `negate` on a positive Int, a negative Int and zero.
passpasspasspass
IntPowTestelm-spec
Checks integer exponentiation `^`, including a zero exponent and a negative base with an odd exponent.
passpasspasspass
IntRemainderByTestelm-spec
Checks that `remainderBy` gives a result with the sign of the dividend, for all four sign combinations of divisor and dividend.
passpasspasspass
IntSubTestelm-spec
Checks integer subtraction `-`, including subtracting a negative literal.
passpasspasspass
JsArrayBasicsTest
`Array.toList`, `Array.length` and `Array.isEmpty` give the expected results on `Array.fromList [1, 2, 3]` and on `Array.empty`.
passpasspasspass
JsArrayFloatFoldlTest
`Array.foldl` and `Array.foldr` over an `Array Float` pass the element values to the folding function.
passpasspasspass
JsArrayFloatMapTest
`Array.map` over an `Array Float` passes the element values to the mapping function.
passpasspasspass
JsArrayGetSetTest
`Array.get` and `Array.set` on a three-element `Array Int`, at valid indices and out of range.
passpasspasspass
JsArrayIndexedFilterTest
`Array.indexedMap`, `Array.filter` and `Array.toIndexedList` give the expected results on small `Array Int` values.
passpasspasspass
JsArrayInitializeRepeatTest
`Array.initialize` and `Array.repeat` build arrays of the requested length, including length zero.
passpasspasspass
JsArrayMapFoldTest
`Array.map`, `Array.foldl` and `Array.foldr` visit an array's elements in the right order.
passpasspasspass
JsArrayPushSliceTest
`Array.push`, `Array.slice` and `Array.append` give the expected elements, including a negative slice start.
passpasspasspass
JsArraySingletonAndPushPrimitivesTest
`Array.repeat 1` and `Array.push` work on arrays of `Int`, `Float` and `Char`.
passpasspasspass
JsArrayUnsafeGetIntTest
`Array.get` returns `Just` the element at a valid index and `Nothing` for an index past the end.
passpasspasspass
JsArrayUnsafeSetCharElementTest
`Array.set` on an `Array Char` replaces the element at the given index and leaves the original array unchanged.
passpasspasspass
JsArrayUnsafeSetFloatElementTest
`Array.set` on an `Array Float` replaces the element at the given index and leaves the original array unchanged.
passpasspasspass
JsArrayUnsafeSetIntElementTest
`Array.set` on an `Array Int` replaces the element at a valid index, and returns the array unchanged for an index out of range.
passpasspasspass
ListAnyBoolTest
`List.any` and `List.all` on `List Bool`, with `identity` and `not` as the predicate, return the expected `True` or `False`.
passpasspasspass
ListAppendTestelm-spec
The `++` operator joins two lists in order, and appending `[]` on the right leaves a list unchanged.
passpasspasspass
ListCompoundElementsTest
Lists whose elements are tuples or records support `List.length`, `List.head` and `List.foldl` over a record field.
passpasspasspass
ListConcatMapTest
`List.concatMap` concatenates the lists its function returns for each element, and gives an empty list for an empty input.
passpasspasspass
ListConcatTestelm-spec
`++` joins lists in order, alone and in a chain of three, and appending to the empty list `[]` gives the other list.
passpasspasspass
ListEmptyTest
The empty list `[]` logs as `[]` and `List.isEmpty []` is `True`.
passpasspasspass
ListFilterTest
`List.filter` keeps the elements that satisfy a named predicate or a partially applied `(==)`, on Int and String lists and on the empty list.
passpasspasspass
ListFoldlTest
`List.foldl` folds from the left, shown by sum, product and `(++)` on strings, where `"cba"` reveals the order.
passpasspasspass
ListFoldrTest
`List.foldr` folds from the right, shown by a sum and by `(++)` on strings, where `"abc"` reveals the order.
passpasspasspass
ListHeadTailTest
`List.head` and `List.tail` return `Just` for a non-empty list and `Nothing` for the empty list.
passpasspasspass
ListIntersperseMemberTest
`List.intersperse` puts a separator between elements, and `List.member` reports whether a value is in a list.
passpasspasspass
ListLengthTest
`List.length` returns 0, 3 and 5 for lists of those lengths.
passpasspasspass
ListMap2345Test
`List.map2` and `List.map3` combine lists element by element.
passpasspasspass
ListMap2FloatSumTest
`List.map2 (+)` on two `List Float`s adds the elements pairwise; `[ 1.5, 2.5 ]` and `[ 10.5, 20.5 ]` give `[12,23]` and the result equals `[ 12.0, 23.0 ]`.
passpasspasspass
ListMap2FloatTest
`List.map2` and `List.map3` on `List Float` pass the Float elements unchanged to the mapping function, giving the expected sums and products.
passpasspasspass
ListMap3FloatTripleSumTest
`List.map3` on three `List Float`s passes the Float elements unchanged to the mapping function; the sums equal `[ 111.0, 222.0 ]`.
passpasspasspass
ListMap4FloatAggregateTest
`List.map4` on four `List Float`s passes the Float elements unchanged to the mapping function; `10 + 1 - 2 - 3` gives `[ 6.0 ]`.
passpasspasspass
ListMap5FloatAggregateTest
`List.map5` on five `List Float`s passes the Float elements unchanged to the mapping function; the sum of 1 to 5 gives `[ 15.0 ]`.
passpasspasspass
ListMapBoolTest
Checks that `List.map` produces correct `List Bool` results, mapping `not` and `identity` over `[True, False, True]`.
passpasspasspass
ListMapTemplateCalleeMemberTest
Checks `List.map` with a callback that applies a function received as a parameter, here a lambda bound to a typed `let` name in `main`.
passpasspasspass
ListMapTemplateCapturedDebugTest
Checks that `List.map` applies its callback to the elements from last to first when the callback logs through a function value it was given rather than calling `Debug.log` directly.
passpasspasspass
ListMapTemplateCtorTest
Checks `List.map` with a constructor as the callback, for three kinds of constructor: `Just` from elm/core, `Tagged` from a custom type that also has a nullary constructor, and `Wrap` from a custom type with a single onโ€ฆ
passpasspasspass
ListMapTemplateLaunderedDebugTest
Checks that `List.map` applies its callback to the elements from last to first when the callback passes a logging comparator it was given to `List.sortWith`.
passpasspasspass
ListMapTemplateLongTest
Checks that `List.map` agrees with a reference map on lists of 2004 to 5000 elements, around the length at which elm/core's `List.foldr` changes strategy.
passpasspasspass
ListMapTemplateMemberTaintTest
Checks that `List.map` applies its callback to the elements from last to first when the callback calls a `let`-bound sorting function whose comparator logs.
passpasspasspass
ListMapTemplateOrderTest
Checks that `List.map` with a callback that calls `Debug.log` logs the elements from last to first.
passpasspasspass
ListMapTemplateTwoLevelTaintTest
Checks that `List.map` applies its callback to the elements from last to first when the callback passes a logging sorter to a top-level function that applies it.
passpasspasspass
ListMapTest
Checks `List.map` with top-level functions that double and square, on a three-element list and on an empty list.
passpasspasspass
ListMapTypeMismatchTest
Checks `List.map` with a function from `Int` to `Bool`, testing which elements of `[1, -1, 2]` are positive.
passpasspasspass
ListPartitionTest
`List.partition` splits a list into the elements that satisfy a predicate and those that do not, each in its original order.
passpasspasspass
ListRangeTest
`List.range` lists the integers from its first argument to its second inclusive, and gives an empty list when the first is greater.
passpasspasspass
ListRebuildKindPreservationTest
Checks that list functions which build a new list from their input return `List Float` and `List Char` values equal to the expected literals, and that arithmetic over such a result is correct.
passpasspasspass
ListRepeatTest
`List.repeat n x` gives a list of `n` copies of `x`, and an empty list when `n` is 0.
passpasspasspass
ListReverseTest
Checks `List.reverse` on an empty list and on lists of three and five integers.
passpasspasspass
ListSortByFloatIdentityTest
Checks `List.sortBy identity` on a `List Float`, by printing the sorted list and comparing it with `[1.0, 2.0, 3.0]`.
passpasspasspass
ListSortByKindPreservationTest
Checks that the results of `List.sortBy` and `List.sort` give correct values when summed or folded, for `Int`, `Float` and `Char` elements.
passpasspasspass
ListSortWithFloatCompareTest
Checks `List.sortWith compare` on a `List Float`, by printing the sorted list and comparing it with `[1.0, 2.0, 3.0]`.
passpasspasspass
ListSortWithKindPreservationTest
Checks that the result of `List.sortWith` gives correct values when summed, folded or searched for its maximum, for `Int`, `Float` and `Char` elements.
passpasspasspass
ListTakeDropTest
List.take and List.drop return the expected prefix and suffix, including for a count of zero.
passpasspasspass
ListToArrayCharRoundtripTest
Converting a `List Char` to an array with `Array.fromList` and back with `Array.toList` gives the original list.
passpasspasspass
ListToArrayFloatRoundtripTest
Converting a `List Float` to an `Array` with `Array.fromList` and back with `Array.toList` returns a list equal to the original.
passpasspasspass
MaybeAndThenTest
`Maybe.andThen` applies a `Maybe`-returning function to a `Just` value and passes `Nothing` through.
passpasspasspass
MaybeMapFloatToBoolTest
`Maybe.map` with a Float -> Bool function produces a `Maybe Bool`: mapping `\x -> x > 0` over `Just 42.0` gives `Just True`.
passpasspasspass
MaybeMapIntToBoolTest
`Maybe.map` with an Int -> Bool function produces a `Maybe Bool`: mapping `\x -> x > 0` over `Just 42` gives `Just True`.
passpasspasspass
MaybeMapStringToBoolTest
`Maybe.map` with a String -> Bool function produces a `Maybe Bool`: mapping `String.isEmpty` over `Just ""` gives `Just True`.
passpasspasspass
MaybeMapTest
`Maybe.map` applies a function inside `Just` and leaves `Nothing` unchanged.
passpasspasspass
MaybeMapToStringTest
`Maybe.map` with an Int -> String function produces a `Maybe String`: mapping `String.fromInt` over `Just 42` gives `Just "42"`.
passpasspasspass
MaybeMapToUnitTest
`Maybe.map` with a function returning unit produces a `Maybe ()`: mapping `\_ -> ()` over `Just 42` gives `Just ()`.
passpasspasspass
MaybeMapTypeMismatchTest
`Maybe.map` with a function whose result type (Bool) differs from its argument type (Float), applied with `|>`, returns the mapped Bool.
passpasspasspass
MaybeWithDefaultTest
`Maybe.withDefault` returns the wrapped value of a `Just` and the default for `Nothing`.
passpasspasspass
NanLibraryContainerSelfEqualityTestelm19-bug
An `Array`, `Dict` or `Set` holding NaN is not equal to itself.
failfailfailfail
NonBmpStringTest
String functions that work a `Char` at a time step over a character outside the Basic Multilingual Plane as one `Char`, while `String.length` counts it as two UTF-16 code units.
passpasspasspass
NotEqualBoolCaseTestelm-spec
The result of `/=` on two `Bool` literals is matched by a `case` with `True` and `False` branches, for all four combinations of operands.
passpasspasspass
NotEqualBoolIfTestelm-spec
The 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.
passpasspasspass
NotEqualBoolListMemberTest
`not (List.member x xs)` gives the right answer for `Bool` values, which relies on `List.member` comparing `Bool`s with `==` correctly.
passpasspasspass
NotEqualBoolMaybeTestelm-spec
`/=` 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 eithโ€ฆ
passpasspasspass
NotEqualBoolPapTestelm-spec
`(/=)` partially applied to a `Bool`, as `(/=) True` and `(/=) False`, works as a function value passed to the local helpers `map`, `filter` and `any`, written with patterns, over `[ True, False, True, False ]`.
passpasspasspass
NotEqualBoolRecordTestelm-spec
`/=` on records of type `{ flag : Bool }` gives the right answer for all four combinations of a record holding `True` and one holding `False`.
passpasspasspass
NotEqualBoolTestelm-spec
`/=` gives the right answer on all four combinations of `Bool` literals, and so does `not` applied to each of those results.
passpasspasspass
NotEqualBoolVarTestelm-spec
`/=` 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.
passpasspasspass
OrderingEmptyListPapTestelm-spec
The operators `<`, `<=`, `>` and `>=` and the function `compare`, partially applied to the empty list, work as function values passed to a local `map`, written with patterns, over `[ [], [ 1 ], [ 1, 2 ] ]`.
passpasspasspass
OrderingEmptyListTestelm-spec
Tests that `<`, `<=`, `>` and `>=` on `List Int` order the empty list before any non-empty list and treat two empty lists as equal.
passpasspasspass
OrderingEmptyStringPapTestelm-spec
Tests `<`, `<=`, `>`, `>=` and `compare` partially applied to `""` and passed as functions to a local `map` written with patterns.
passpasspasspass
OrderingEmptyStringTestelm-spec
Tests that `<`, `<=`, `>` and `>=` on `String` order `""` before any non-empty string and treat two empty strings as equal.
passpasspasspass
OrderingMixedCaptureTestelm-spec
Tests `(<)` and `(>=)` passed as arguments to one polymorphic counting helper, used at `Int`, `Float` and `Char` in the same program.
passpasspasspass
OrderingTupleWithEmptyListTestelm-spec
Tests `<`, `<=`, `>` and `>=` on `( Int, List Int )` tuples whose first components are equal, so the result is decided by comparing `[]` with `[ 1 ]` in the second component.
passpasspasspass
OrderingTupleWithEmptyStringTestelm-spec
Tests `<`, `<=`, `>` and `>=` on `( Int, String )` tuples whose first components are equal, so the result is decided by comparing `""` with `"a"` in the second component.
passpasspasspass
PipelineTestelm-spec
Tests the pipeline operators `|>` and `<|`: a chain of forward pipes, a forward pipe into a partially applied local `map`, written with patterns, and a chain of backward pipes.
passpasspasspass
ProcessKillRunnableTestelm-unspecced
`Process.kill` stops a process that is waiting in the scheduler's queue to run, not only one waiting on a task.
passpasspasspass
ProcessPrimitiveOutcomeTestelm-spec
The primitive tasks `Process.sleep`, `Process.spawn` and `Process.kill` succeed with their outcomes.
passpasspasspass
ProcessSleepNonFiniteTestelm-unspecced
`Process.sleep` given an infinite or NaN delay still wakes, and wakes before a 2000 ms sleep started at the same time.
passpasspasspass
ProcessSpawnKillHalfTestelm-spec
A process killed with `Process.kill` before its sleep finishes never runs the rest of its task, while the processes left alive do.
passpasspasspass
ProcessSpawnRecursiveTestelm-spec
A process spawned with `Process.spawn` can itself spawn a process, nested five deep, and every level runs.
passpasspasspass
ProcessSpawnedFailureEndsTestelm-spec
A spawned process whose task fails ends quietly, and the program goes on.
passpasspasspass
ProcessYieldThrashingTestelm-spec
Two processes that each repeatedly yield with `Process.sleep 0` both run to completion.
passpasspasspass
RecordFieldPrimitivesRegressionFTest
`String` functions give the same results on a string read out of a record field inside a custom type, whether the string is a literal or built at run time with `++`.
passpasspasspass
ResultAndThenTest
Checks that `Result.andThen` passes an `Ok` value to the next step and propagates an `Err` unchanged.
passpasspasspass
ResultMapTest
Checks that `Result.map` applies its function to an `Ok` value (`Ok 42` doubled gives `Ok 84`) and leaves an `Err` unchanged.
passpasspasspass
ResultMapTypeMismatchTest
Checks that `Result.map` can change the `Ok` type, here mapping `Ok 42` through `\x -> x > 0` from `Int` to `Bool` to get `Ok True`.
passpasspasspass
ResultWithDefaultTest
Checks that `Result.withDefault` returns the `Ok` value when there is one (`42`) and the default (`0`) for an `Err`.
passpasspasspass
RoundToIntTestelm-spec
Checks that `round` converts a `Float` to the nearest `Int`: `2.7` gives `3`, `2.3` gives `2` and `-2.7` gives `-3`.
passpasspasspass
SetTupleListKeyTest
A `Set` of `( Int, List Int )` tuples orders its elements with `compare` and drops duplicates by equality, including when the list component is empty.
passpasspasspass
SortByAlwaysEmptyListKeyTest
`List.sortBy` with a key function that returns `[]` for every element leaves the list in its original order.
passpasspasspass
SortByAlwaysEmptyStringKeyTest
`List.sortBy` with a key function that returns `""` for every element leaves the list in its original order.
passpasspasspass
SortByDerivedEmptyListTest
`List.sortBy List.reverse` sorts a list of lists, two of them empty, by their reversed contents.
passpasspasspass
SortByDerivedEmptyStringTest
`List.sortBy String.reverse` sorts strings by their reversed text, with the empty strings first.
passpasspasspass
SortByEmptyListKeyMixedTest
`List.sortBy` with a key function that returns `[]` for some elements and a one-element list for others puts the `[]` keys first and keeps input order among equal keys.
passpasspasspass
SortByEmptyStringKeyMixedTest
`List.sortBy` orders by a String key that is `""` for some elements and `"x"` for others.
passpasspasspass
SortByIdentityEmptyListTest
`List.sortBy identity` on a list of `List Int` values, two of which are `[]`, puts the empty lists first.
passpasspasspass
SortByIdentityEmptyStringTest
`List.sortBy identity` on a list of Strings that contains `""` twice puts both empty strings first.
passpasspasspass
SortByTupleWithEmptyListTest
`List.sortBy` with a tuple key whose second component is sometimes `[]` orders by the first component, then by the list.
passpasspasspass
SortByTupleWithEmptyStringTest
`List.sortBy` with a tuple key whose second component is sometimes `""` orders by the first component, then by the string.
passpasspasspass
SortByTupleWithMixedConstantsTest
`List.sortBy` with a `( Int, List Int )` key whose list is `[]` for positive inputs and `[ -n ]` otherwise orders by the distinct first components.
passpasspasspass
SortCharTest
`List.sort`, `List.sortWith` and `List.sortBy` order a `List Char` correctly and return the elements as `Char` values.
passpasspasspass
SortEmptyListInListTest
`List.sort` on a `List (List Int)` that contains `[]` twice puts the empty lists first.
passpasspasspass
SortEmptyStringInListTest
`List.sort` on a list of Strings that contains `""` twice puts both empty strings first.
passpasspasspass
SortFloatTest
`List.sort`, `List.sortBy` and `List.sortWith` order a `List Float` correctly and keep fractional values intact.
passpasspasspass
SortWithCompareEmptyListTest
`List.sortWith compare` on a `List (List Int)` that contains `[]` twice puts the empty lists first.
passpasspasspass
SortWithCompareEmptyStringTest
`List.sortWith compare` on a list of Strings that contains `""` twice puts both empty strings first.
passpasspasspass
StandardA40IntOverflowTestelm19-bugelm-spec
Int `+`, `-` and `*` give an Int, never an infinity or NaN, however large the exact result.
failfailfailfail
StandardA41IntDivisionWideTestelm19-bugelm-spec
`a // 1` is `a`, also for an `a` beyond 32 bits.
failfailfailfail
StandardA42ModByZeroTestelm19-bugelm-spec
`modBy 0 x` is `0`.
failfailfailfail
StandardA42RemainderByZeroTestelm19-bugelm-spec
`remainderBy 0 x` is `0`.
failfailfailfail
StandardA42ZeroDivisorTestelm19-bugelm-spec
`3 // 0`, `modBy 0 3` and `remainderBy 0 3` are all `0`: the examples A Standard Definition of Elm? gives for ruling A42 in its initial dynamic basis.
failfailfailfail
StandardA43PowNegativeTestelm19-bugelm-spec
Int `^` with a negative exponent: `1 ^ n` is `1`, `(-1) ^ n` is `1` or `-1` by the parity of `n`, and any other base gives `0`.
failfailfailfail
StandardA44RoundNonFiniteTestelm19-bugelm-spec
`round`, `floor` and `ceiling` of NaN are `0`, and of an infinity an Int.
failfailfailfail
StandardA44TruncateWideTestelm19-bugelm-spec
`truncate` of a Float beyond 32 bits does not wrap.
failfailfailfail
StandardA45IntNegativeZeroTestelm19-bugelm-spec
Int has one zero: no Int operation gives a negative zero.
failfailfailfail
StandardA46CompareNanTestelm19-bugelm-spec
`compare` is a total order on Float: NaN is above every other float and equal to NaN.
failfailfailfail
StandardA48MinMaxNanTestelm19-bugelm-spec
Float `min` and `max` are IEEE 754-2019 minimum and maximum, whatever the order of the arguments.
failfailfailfail
StandardA49ClampTestelm19-bugelm-spec
`clamp lo hi x`: at Float it is `min (max x lo) hi`, with the IEEE 754 `maximum` and `minimum` that propagate NaN and order `-0` below `+0`; at Int it is the text of elm/core.
failfailfailfail
StandardA51FunctionEqualityTestelm19-bugelm-spec
`==` on two functions gives a Bool; the program goes on.
failfailfailfail
StandardA53CharOrderTestelm19-bugelm-spec
Characters are ordered by their code points.
failfailfailfail
StandardA53StringOrderTestelm19-bugelm-spec
Strings are ordered character by character, by code point.
failfailfailfail
StandardA65PowOneTestelm19-bugelm-spec
Float `1 ^ y` is `1` for every `y`, and `(-1) ^ y` is `1` for an infinite `y`.
failfailfailfail
StandardA81SleepBeyond32BitsTestelm19-bugelm-spec
`Process.sleep d` waits at least `d` milliseconds, also when `d` is above 2^31 - 1.
failfailfailfail
StringAnyAllTest
`String.any` and `String.all` with `Char.isDigit` give `True` and `False` on strings with and without digits.
passpasspasspass
StringAstralAnyAllFilterTest
`String.any`, `String.all`, `String.filter` and `String.foldr` see a character outside the Basic Multilingual Plane, such as an emoji, as one `Char`.
passpasspasspass
StringAstralFoldTest
`String.foldl` and `String.foldr` visit a character outside the Basic Multilingual Plane, such as an emoji, once, as one `Char`.
passpasspasspass
StringAstralLengthTest
`String.length` counts UTF-16 code units, so a character outside the Basic Multilingual Plane counts as 2.
passpasspasspass
StringAstralMapTest
`String.map` applies its function once to a character outside the Basic Multilingual Plane, such as an emoji, and can produce such a character.
passpasspasspass
StringAstralReverseTest
`String.reverse` keeps a character outside the Basic Multilingual Plane, such as an emoji, whole, rather than reversing the two UTF-16 units it is stored as.
passpasspasspass
StringAstralToListFromListTest
`String.toList` gives one `Char` for a character outside the Basic Multilingual Plane, such as an emoji, and `String.fromList` turns it back into the same string.
passpasspasspass
StringAstralUnconsTest
`String.uncons` splits a whole character outside the Basic Multilingual Plane, such as an emoji, off the front of a string, and `String.cons` puts it back.
passpasspasspass
StringCaseTest
`String.toUpper` and `String.toLower` map titlecase letters, letters outside the Basic Multilingual Plane, mixed scripts and some capital sigmas one code point to one.
passpasspasspass
StringConcatContentTestelm-spec
A chain of twenty `++` operations and 100 nested `++` operations built by recursion both produce the right text.
passpasspasspass
StringConcatTestelm-spec
`++` joins strings.
passpasspasspass
StringConsDynamicTest
`String.cons` rebuilds a string from the `Char` and rest that `String.uncons` split it into.
passpasspasspass
StringContainsTest
`String.contains` finds a substring that is present, rejects one that is not, and reports that the empty string is contained in any string.
passpasspasspass
StringCreationLibraryMatrixTest
The same string produced in different ways is `==`, finds the same `Dict` entry, and matches the same string pattern in a `case`.
passpasspasspass
StringEmptyTest
The empty string literal prints as `""` and `String.isEmpty ""` is `True`.
passpasspasspass
StringFoldlTest
Checks that `String.foldl` visits characters from the left and `String.foldr` from the right.
passpasspasspass
StringFromFloatJsFormatTest
`String.fromFloat` writes numbers as JavaScript's `Number.prototype.toString` does: plain digits for magnitudes from 1e-6 up to but not including 1e21, and exponent form (`1e+21`, `1.5e+300`, `1e-7`, `1.25e-7`) outside โ€ฆ
passpasspasspass
StringFromIntFloatTest
Checks `String.fromInt`, `String.fromFloat` and `String.fromChar` on one value each: `42`, `3.14` and `'A'`.
passpasspasspass
StringFromNumberCaptureTest
`String.fromInt` and `String.fromFloat` work when passed unapplied, as the function argument of `List.map`.
passpasspasspass
StringFromNumberFloatTest
`String.fromFloat` prints zero, positive, negative and small fractions in their shortest form, and prints a whole-valued `Float` without a decimal point (`42.0` as `"42"`, `0.0` as `"0"`).
passpasspasspass
StringFromNumberIntTest
`String.fromInt` prints zero, positive and negative integers, including the 32-bit signed limits `2147483647` and `-2147483648`.
passpasspasspass
StringIndexesTest
Checks that `String.indexes` returns every position where a substring occurs, and an empty list when it never does.
passpasspasspass
StringJoinTest
Checks `String.join` with a multi-character separator, an empty separator, an empty list, a single-element list, and lists of empty strings, plus `String.replace` on an empty string.
passpasspasspass
StringKernelEdgeTest
Edge cases of elm/core's string functions: `String.indexes ""` is `[]`, `String.toInt` accepts a leading `+`, and trimming and `String.words` treat all JavaScript whitespace as whitespace.
passpasspasspass
StringLargeSliceTest
Checks that `String.slice` on a 500-character string returns a 250-character slice with the right content at both ends.
passpasspasspass
StringLeftRightDropTest
Checks `String.left`, `String.right`, `String.dropLeft` and `String.dropRight` on `"Hello"`.
passpasspasspass
StringLengthFormsTest
`String.length` gives the right count for strings built in several different ways, not only for literals.
passpasspasspass
StringLengthTest
`String.length` returns 5 for `"Hello"`, 0 for the empty string, and 13 for `"Hello, World!"`.
passpasspasspass
StringMapFilterTest
Checks that `String.map` transforms every character and `String.filter` keeps only the characters its predicate accepts.
passpasspasspass
StringOpChainSurvivalTest
Checks that `String` functions give the same results on a string built at run time as they would on the equivalent literal.
passpasspasspass
StringPadTest
Checks that `String.padLeft` and `String.padRight` pad a string to the requested length with the given character.
passpasspasspass
StringRepeatTest
Checks that `String.repeat` concatenates `n` copies of a string, giving the empty string when `n` is 0.
passpasspasspass
StringRopeContentTest
Checks that a 140000-character string built by 1400 successive appends has the right length and intact content at both ends.
passpasspasspass
StringRopeFoldlSliceTest
Checks `String.foldl` and `String.reverse` over a 40000-character string built by 400 successive appends.
passpasspasspass
StringSliceTest
Checks `String.slice` with positive indexes and with negative indexes, which count back from the end of the string.
passpasspasspass
StringSourceSweepRegressionETest
Checks that a small character-by-character parser gives the same answer for the string `"\"hi\""` however that string was built.
passpasspasspass
StringSplitTest
Checks `String.split` with a single-character separator, a multi-character separator and a trailing separator, plus the number of pieces.
passpasspasspass
StringStartsEndsTest
Checks that `String.startsWith` and `String.endsWith` each give `True` for a matching prefix or suffix of `"Hello"` and `False` for one that is not.
passpasspasspass
StringToFloatLiteralTest
`String.toFloat "1.5"` gives `Just 1.5`, equal to the literal `1.5`.
passpasspasspass
StringToFloatOutOfRangeTest
Checks that `String.toFloat` accepts a well-formed number whose magnitude is outside the range of a finite `Float`: an overflow gives `Infinity` (or `-Infinity`) and an underflow gives `0`.
passpasspasspass
StringToIntFloatTest
Checks that `String.toInt` and `String.toFloat` return `Just` the number for a numeric string and `Nothing` for a non-numeric one.
passpasspasspass
StringToListFromListTest
`String.toList` and `String.fromList` convert between a string and its characters, in both directions and on empty input.
passpasspasspass
StringToListLoneSurrogateTest
`String.toList` of a string holding a lone low surrogate returns one `Char`.
failfailfailfail
StringTrimTest
`String.trim`, `String.trimLeft` and `String.trimRight` remove whitespace from both ends, the start only and the end only of `" hello "`.
passpasspasspass
StringWordsLinesTest
`String.words` splits `"hello world"` at the space and `String.lines` splits `"line1\nline2"` at the newline, each into two parts.
passpasspasspass
StringWordsUnicodeSpaceTestelm-unspecced
`String.words` splits on non-ASCII whitespace (U+00A0, U+3000, U+2028) and gives `[""]` for a string that is only whitespace.
passpasspasspass
StringZeroLenJoinTest
`String.join`, `String.concat` and `String.replace` return a true empty string when the result is empty although the input list or string is not.
passpasspasspass
StringZeroLenJoinUtf16Test
`String.join` with a non-ASCII separator over a single empty element returns a true empty string: the separator is never inserted, so the result is `""`.
passpasspasspass
StringZeroLenSliceTest
`String.slice`, `left`, `right`, `dropLeft` and `dropRight` return a true empty string when asked for an empty range, for short and long, ASCII and non-ASCII inputs.
passpasspasspass
StringZeroLenSplitLongSepTest
`String.split` with a separator longer than the input returns the input unchanged as the single part.
passpasspasspass
StringZeroLenSplitTest
`String.split` and `String.lines` return true empty strings for the empty parts produced by leading, trailing and adjacent separators.
passpasspasspass
StringZeroLenTransformTest
`String` functions that transform a whole string return a true empty string when the result is empty.
passpasspasspass
TaskAttemptErrorTestelm-spec
`Task.attempt` delivers both outcomes to `update` in a `Platform.worker`: `Ok` with the value of a succeeding task and `Err` with the error of a failing one.
passpasspasspass
TaskOnErrorCascadeTestelm-spec
`Task.onError` recovers a failed `Task.andThen` chain, skipping the steps between the failure and the handler, and the recovered task can be chained further.
passpasspasspass
TaskOnErrorInnerTestelm-spec
`Task.onError` lets its task take steps before it succeeds or fails.
passpasspasspass
TaskOnErrorSucceedTestelm-spec
`Task.onError` on a task that succeeds gives that task's value; the handler is not called.
passpasspasspass
TaskPerformValueTestelm-spec
`Task.perform` delivers the task's value to `update` in a `Platform.worker`, for messages that carry an `Int`, a negative `Int` or a `String`, and for a message built by a function that ignores the value.
passpasspasspass
TaskSucceedAsArgTestelm-spec
`Task.succeed`, passed as a function value to a polymorphic `apply : (a -> b) -> a -> b` with `a` instantiated to `Int`, produces a task that `Task.perform` delivers to `update` with the value 7.
passpasspasspass
TestIndexedMap
`Array.indexedMap` passes each element's index, counting from 0, along with the element: pairing them on `[10, 20, 30]` gives `[(0,10),(1,20),(2,30)]`.
passpasspasspass
TestIndexedMap2
`Array.map` applies a function to every element: doubling `[10, 20, 30]` gives `[20, 40, 60]`.
passpasspasspass
TestIndexedMap3
`Array.indexedMap` with a function that ignores the index returns the elements unchanged, `[10, 20, 30]`.
passpasspasspass
TimerEffectTestelm-spec
A `Platform.worker` that chains `Process.sleep` timers through `Task.perform` receives each timer message in turn and stops after five.
passpasspasspass
ToFloatTestelm-spec
`toFloat` converts a positive, a negative and a zero `Int` to the equal `Float`.
passpasspasspass
TruncateToIntTestelm-spec
`truncate` rounds a `Float` towards zero: 2.7 gives 2 and -2.7 gives -2.
passpasspasspass
TupleFirstTest
`Tuple.first` returns the first component of an `Int` pair and of a `String` pair.
passpasspasspass
TupleIndexedCharTest
`List.indexedMap Tuple.pair` over the characters of `"Hello"` builds `( Int, Char )` pairs, and the first one is `(0,'H')`.
passpasspasspass
TupleMapFirstTest
`Tuple.mapFirst` applies a function to the first component of a pair and leaves the second unchanged.
passpasspasspass
TupleMapSecondTest
`Tuple.mapSecond` applies a function to the second component of a pair and leaves the first unchanged.
passpasspasspass
TuplePairFuncTest
`Tuple.pair` builds a pair from two `Int` arguments and from two `String` arguments.
passpasspasspass
TupleSecondTest
`Tuple.second` returns the second component of an `Int` pair and of a `String` pair.
passpasspasspass
UtilsEqualityCaptureCharTestelm-spec
`(==)` and `(/=)` on `Char` give the same answers when passed as function values as when applied directly.
passpasspasspass
UtilsEqualityCaptureFloatTestelm-spec
`(==)` and `(/=)` on `Float` give the same answers when passed as function values as when applied directly.
passpasspasspass
UtilsEqualityCaptureIntTestelm-spec
`(==)` and `(/=)` on `Int` give the same answers when passed as function values as when applied directly.
passpasspasspass
UtilsOrderingCaptureCharTestelm-spec
`(<)`, `(<=)`, `(>)` and `(>=)` on `Char` give the right answers when passed as function values or applied in prefix form.
passpasspasspass
UtilsOrderingCaptureFloatTestelm-spec
`(<)`, `(<=)`, `(>)` and `(>=)` on `Float` give the right answers when passed as function values or applied in prefix form.
passpasspasspass
UtilsOrderingCaptureIntTestelm-spec
`(<)`, `(<=)`, `(>)` and `(>=)` on `Int` give the right answers when passed as function values or applied in prefix form.
passpasspasspass

Discussions

Discuss this projectยทSearch the discussions on GitHub

Discussions are on GitHub; one about this project has [p:elm-core] in its title.