test(parser): list spread

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

View File

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

View File

@ -0,0 +1,30 @@
---
source: crates/aiken-lang/src/parser/expr/list.rs
description: "Code:\n\n[1, 2, ..[]]"
---
List {
location: 0..12,
elements: [
Int {
location: 1..2,
value: "1",
base: Decimal {
numeric_underscore: false,
},
},
Int {
location: 4..5,
value: "2",
base: Decimal {
numeric_underscore: false,
},
},
],
tail: Some(
List {
location: 9..11,
elements: [],
tail: None,
},
),
}