mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-24 18:39:50 -04:00
TESTS: Expresions as field values in lists and tuples.
This commit is contained in:
parent
c6037f6ea7
commit
04480663e8
@ -93,6 +93,18 @@ fn test_list_ops() {
|
|||||||
vec![InitList, Val(Int(2)), Element, Val(Int(1)), Element],
|
vec![InitList, Val(Int(2)), Element, Val(Int(1)), Element],
|
||||||
C(List(vec![P(Int(2)), P(Int(1))])),
|
C(List(vec![P(Int(2)), P(Int(1))])),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
vec![
|
||||||
|
InitList,
|
||||||
|
Val(Int(1)),
|
||||||
|
Element,
|
||||||
|
Val(Int(1)),
|
||||||
|
Val(Int(1)),
|
||||||
|
Add,
|
||||||
|
Element,
|
||||||
|
],
|
||||||
|
C(List(vec![P(Int(1)), P(Int(2))])),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
for case in cases.drain(0..) {
|
for case in cases.drain(0..) {
|
||||||
let mut vm = VM::new(case.0);
|
let mut vm = VM::new(case.0);
|
||||||
@ -143,6 +155,27 @@ fn test_tuple_ops() {
|
|||||||
("foo".to_owned(), P(Int(2))),
|
("foo".to_owned(), P(Int(2))),
|
||||||
])),
|
])),
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
vec![
|
||||||
|
InitTuple,
|
||||||
|
Sym("bar".to_owned()),
|
||||||
|
Val(Str("ux".to_owned())),
|
||||||
|
Val(Str("qu".to_owned())),
|
||||||
|
Add,
|
||||||
|
FIELD,
|
||||||
|
Val(Str("foo".to_owned())),
|
||||||
|
Val(Int(1)),
|
||||||
|
FIELD,
|
||||||
|
Cp,
|
||||||
|
Val(Str("foo".to_owned())),
|
||||||
|
Val(Int(2)),
|
||||||
|
FIELD,
|
||||||
|
],
|
||||||
|
C(Tuple(vec![
|
||||||
|
("bar".to_owned(), P(Str("quux".to_owned()))),
|
||||||
|
("foo".to_owned(), P(Int(2))),
|
||||||
|
])),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
for case in cases.drain(0..) {
|
for case in cases.drain(0..) {
|
||||||
let mut vm = VM::new(case.0);
|
let mut vm = VM::new(case.0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user