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:
KtorZ 2022-12-19 18:55:50 +01:00
parent dbd3d3fd7d
commit f511b2f71b
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
2 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,2 @@
name = "acceptance_test_024"
version = "0.0.0"

View File

@ -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))
}