Add new acceptance test scenario (010)
``` Error: × Main thread panicked. ├─▶ at crates/lang/src/uplc.rs:688:33 ╰─▶ called `Option::unwrap()` on a `None` value help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace. ```
This commit is contained in:
parent
4217fd06b5
commit
37def91fc5
|
@ -0,0 +1,2 @@
|
||||||
|
name = "acceptance_test_010"
|
||||||
|
version = "0.0.0"
|
|
@ -0,0 +1,14 @@
|
||||||
|
pub fn map(opt: Option<a>, f: fn(a) -> b) -> Option<b> {
|
||||||
|
when opt is {
|
||||||
|
None -> None
|
||||||
|
Some(a) -> Some(f(a))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn add_one(n: Int) -> Int {
|
||||||
|
n + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
test map_1() {
|
||||||
|
map(None, add_one) == None
|
||||||
|
}
|
Loading…
Reference in New Issue