Test closure definition with parens around

This commit is contained in:
Kiryl Dziamura 2023-07-03 15:41:06 +02:00
parent 3ccb6114b2
commit c90c399751
No known key found for this signature in database
GPG key ID: FB539501A4561ACF
2 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,47 @@
#[cfg(feature = "gen-llvm")]
use crate::helpers::llvm::assert_evals_to;
#[cfg(feature = "gen-dev")]
use crate::helpers::dev::assert_evals_to;
#[cfg(feature = "gen-wasm")]
use crate::helpers::wasm::assert_evals_to;
// use crate::helpers::with_larger_debug_stack;
//use crate::assert_wasm_evals_to as assert_evals_to;
#[allow(unused_imports)]
use indoc::indoc;
#[allow(unused_imports)]
use roc_std::{RocList, RocResult, RocStr};
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
fn def_closure_in_parens() {
assert_evals_to!(
indoc!(
r#"
id = (\x -> x)
id 42u32
"#
),
42,
u32
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))]
fn def_closure_in_multiple_parens() {
assert_evals_to!(
indoc!(
r#"
id = (((\x -> x)))
id 42u32
"#
),
42,
u32
);
}

View file

@ -6,6 +6,7 @@
pub mod gen_abilities;
pub mod gen_compare;
pub mod gen_definitions;
pub mod gen_dict;
pub mod gen_list;
pub mod gen_num;