test(parser): int list

This commit is contained in:
rvcas 2023-07-01 14:54:55 -04:00
parent f9c099a923
commit 44d0432560
No known key found for this signature in database
GPG Key ID: C09B64E263F7D68C
2 changed files with 36 additions and 0 deletions

View File

@ -39,4 +39,9 @@ mod tests {
fn empty_list() { fn empty_list() {
assert_expr!("[]"); assert_expr!("[]");
} }
#[test]
fn int_list() {
assert_expr!("[1, 2, 3]");
}
} }

View File

@ -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,
}