mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Test closure definition with parens around
This commit is contained in:
parent
3ccb6114b2
commit
c90c399751
2 changed files with 48 additions and 0 deletions
47
crates/compiler/test_gen/src/gen_definitions.rs
Normal file
47
crates/compiler/test_gen/src/gen_definitions.rs
Normal 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
|
||||
);
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue