aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 3f753f1..22b6713 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1056,6 +1056,14 @@ a.a <=> 0"
);
test_multiple!(
+ fancy_call,
+ not: "f := fn {}\n f!\n",
+ one_arg: "f := fn a:int { a <=> 1 }\n f! 1\n",
+ two_arg: "f := fn a:int, b:int { b <=> 3 }\n f! 1, 1 + 2\n",
+ three_arg: "f := fn a:int, b:int, c:int { c <=> 13 }\n f! 1, 1 + 2, 1 + 4 * 3\n",
+ );
+
+ test_multiple!(
newline_regression,
simple: "a := 1 // blargh \na += 1 // blargh \n a <=> 2 // HARGH",
expressions: "1 + 1 // blargh \n 2 // blargh \n // HARGH \n",
@@ -1069,7 +1077,35 @@ a <=> 1
b := 2
{
a <=> 1
+}",
+ );
+
+ 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
",
);
}