test(parser): list spread
This commit is contained in:
parent
44d0432560
commit
baf807ca2d
|
@ -44,4 +44,9 @@ mod tests {
|
||||||
fn int_list() {
|
fn int_list() {
|
||||||
assert_expr!("[1, 2, 3]");
|
assert_expr!("[1, 2, 3]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn list_spread() {
|
||||||
|
assert_expr!("[1, 2, ..[]]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
}
|
Loading…
Reference in New Issue