Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottCarda-MS committed Dec 12, 2024
1 parent a474203 commit b609dc3
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions compiler/qsc_parse/src/expr/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,30 @@ fn set() {
);
}

#[test]
fn set_chained() {
check(
expr,
"set x = set y = z",
&expect![[r#"
Expr _id_ [0-17]: Assign:
Expr _id_ [4-5]: Path: Path _id_ [4-5] (Ident _id_ [4-5] "x")
Expr _id_ [8-17]: Assign:
Expr _id_ [12-13]: Path: Path _id_ [12-13] (Ident _id_ [12-13] "y")
Expr _id_ [16-17]: Path: Path _id_ [16-17] (Ident _id_ [16-17] "z")"#]],
);
check(
expr,
"x = y = z",
&expect![[r#"
Expr _id_ [0-9]: Assign:
Expr _id_ [0-1]: Path: Path _id_ [0-1] (Ident _id_ [0-1] "x")
Expr _id_ [4-9]: Assign:
Expr _id_ [4-5]: Path: Path _id_ [4-5] (Ident _id_ [4-5] "y")
Expr _id_ [8-9]: Path: Path _id_ [8-9] (Ident _id_ [8-9] "z")"#]],
);
}

#[test]
fn set_hole() {
check(
Expand Down

0 comments on commit b609dc3

Please sign in to comment.