Add another failing test example (d)

```
  Error:
    × Main thread panicked.
    ├─▶ at crates/lang/src/uplc.rs:3264:35
    ╰─▶ called `Option::unwrap()` on a `None` value
    help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
  ```
This commit is contained in:
KtorZ 2022-12-13 11:19:16 +01:00
parent d78e2c9c6f
commit 8f69a4b600
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 = "test_d"
version = "0.0.0"

View File

@ -0,0 +1,18 @@
pub fn foldr(xs: List(a), f: fn(a, b) -> b, zero: b) -> b {
when xs is {
[] -> zero
[x, ..rest] -> f(x, foldr(rest, f, zero))
}
}
pub fn prepend(x: a, xs: List(a)) -> List(a) {
[x, ..xs]
}
pub fn concat(left: List(a), right: List(a)) -> List(a) {
foldr(left, prepend, right)
}
test concat_1() {
concat([1, 2, 3], [4, 5, 6]) == [1, 2, 3, 4, 5, 6]
}