Skip to content

Commit ca01236

Browse files
committed
Fix typos in docs
1 parent d00b290 commit ca01236

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

fantasy-docs.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -429,25 +429,25 @@ division_by_1_doesnt_change_number = () =>
429429
// from the "Constants" section above.
430430
#[test]
431431
division_by_10 =
432-
let
433-
expected = 10;
434-
actual = 100/10;
435-
in assert_eq(expected, actual)
432+
let
433+
expected = 10;
434+
actual = 100/10;
435+
in assert_eq(expected, actual)
436436
```
437437
The `assert_eq` function will fail the test if the arguments aren't equal. There are similar functions like `assert()` which just checks if its argument is true, or `assert_ne()` which asserts the two are not equal. Tests are run in parallel, because there's no way for two tests to interfere with each other.
438438

439439
Test functions cannot take parameters, nor can they return values. So, what if you want to test many different (expected, actual) pairs for your function? Well, you can call `assert_eq` on a list of values. Like this:
440440

441441
```kcl
442442
#[test]
443-
multiplication_by_zero() =
444-
let
445-
n = 100
446-
inputs = List.range(0, n) // A list of numbers from `0` to `n`.
447-
expected = List.replicate(0, n) // A list of length `n`, every element is `0`.
448-
actual = List.map((x) => x * 0, inputs)
449-
in
450-
List.map2(assert_eq, actual, expected)
443+
multiplication_by_zero = () =>
444+
let
445+
n = 100
446+
inputs = List.range(0, n) // A list of numbers from `0` to `n`.
447+
expected = List.replicate(0, n) // A list of length `n`, every element is `0`.
448+
actual = List.map((x) => x * 0, inputs)
449+
in
450+
List.map2(assert_eq, actual, expected)
451451
```
452452
Here, the function `List.map2` is a lot like `List.map` except it has _two_ input lists. Its function argument takes an element from each list, instead of just from one list. So, it takes a function of type `(a, b) => c`, a `List a` and a `List b` and passes them into the function, element by element, creating a `List c`.
453453

0 commit comments

Comments
 (0)