diff --git a/crates/aiken-lang/src/parser/expr/list.rs b/crates/aiken-lang/src/parser/expr/list.rs index 3349b9a1..69dd4b22 100644 --- a/crates/aiken-lang/src/parser/expr/list.rs +++ b/crates/aiken-lang/src/parser/expr/list.rs @@ -39,4 +39,9 @@ mod tests { fn empty_list() { assert_expr!("[]"); } + + #[test] + fn int_list() { + assert_expr!("[1, 2, 3]"); + } } diff --git a/crates/aiken-lang/src/parser/expr/snapshots/int_list.snap b/crates/aiken-lang/src/parser/expr/snapshots/int_list.snap new file mode 100644 index 00000000..a2040224 --- /dev/null +++ b/crates/aiken-lang/src/parser/expr/snapshots/int_list.snap @@ -0,0 +1,31 @@ +--- +source: crates/aiken-lang/src/parser/expr/list.rs +description: "Code:\n\n[1, 2, 3]" +--- +List { + location: 0..9, + elements: [ + Int { + location: 1..2, + value: "1", + base: Decimal { + numeric_underscore: false, + }, + }, + Int { + location: 4..5, + value: "2", + base: Decimal { + numeric_underscore: false, + }, + }, + Int { + location: 7..8, + value: "3", + base: Decimal { + numeric_underscore: false, + }, + }, + ], + tail: None, +}