Add new acceptance test scenario 024
``` × map2_3 failed help: ┍━ left ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑ │ Type mismatch expected 'integer' got 'pair data data' │ ┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙ should be equal to ┍━ right ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┑ │ Type mismatch expected 'list pair data data' got 'list data' │ ┕━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┙ ```
This commit is contained in:
parent
dbd3d3fd7d
commit
f511b2f71b
|
@ -0,0 +1,2 @@
|
||||||
|
name = "acceptance_test_024"
|
||||||
|
version = "0.0.0"
|
|
@ -0,0 +1,18 @@
|
||||||
|
pub fn map2(
|
||||||
|
opt_a: Option<a>,
|
||||||
|
opt_b: Option<b>,
|
||||||
|
f: fn(a, b) -> result,
|
||||||
|
) -> Option<result> {
|
||||||
|
when opt_a is {
|
||||||
|
None -> None
|
||||||
|
Some(a) ->
|
||||||
|
when opt_b is {
|
||||||
|
None -> None
|
||||||
|
Some(b) -> Some(f(a, b))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test map2_3() {
|
||||||
|
map2(Some(14), Some(42), fn(a, b) { #(a, b) }) == Some(#(14, 42))
|
||||||
|
}
|
Loading…
Reference in New Issue