aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-02-10 22:12:41 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-02-10 22:12:41 +0100
commit9596dadf3ad99aefec2547f4f8294d772811d8be (patch)
tree3dbcd78b5acfdb34d8e6053fa4517a5c619c11ac /src
parentcd1e464c11fb84ef8319e52019c23c0a91d5e3a7 (diff)
downloadsylt-9596dadf3ad99aefec2547f4f8294d772811d8be.tar.gz
add regression tests
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ae45c45..d8d9505 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1050,4 +1050,33 @@ a.a <=> 0"
simple: "a := 1 // blargh \na += 1 // blargh \n a <=> 2 // HARGH",
expressions: "1 + 1 // blargh \n 2 // blargh \n // HARGH \n",
);
+
+ test_multiple!(
+ assignment_op_regression,
+ simple_add: "
+a := 0
+b := 99999
+a += 1
+a <=> 1
+",
+
+ simple_sub: "
+a := 0
+b := 99999
+a -= 1
+a <=> -1
+",
+
+ strange: "
+a := 0
+{
+ b := 99999
+ {
+ a := 99999
+ }
+ a -= 1
+}
+a <=> -1
+",
+ );
}