summaryrefslogtreecommitdiff
path: root/src/source.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2021-11-08 12:01:35 +0100
committerMartin Haug <mhaug@live.de>2021-11-08 12:01:35 +0100
commit9141cba6a9db6ae3106e39d92508cb91c390049b (patch)
tree237c990649424ce32b5f0e03d50c74935eede2fa /src/source.rs
parent0663758fbb42651a08bfcd46c27b5cdeab90fb75 (diff)
Deal with the effects of keywords
Diffstat (limited to 'src/source.rs')
-rw-r--r--src/source.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/source.rs b/src/source.rs
index 36db50dd..2bba86a9 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -558,11 +558,15 @@ mod tests {
// Test type invariants.
test("#for x in array {x}", 16 .. 19, "[#x]", true);
test("#let x = 1 {5}", 1 .. 4, "if", false);
+ test("{let x = 1 {5}}", 1 .. 4, "if", true);
test("#let x = 1 {5}", 4 .. 4, " if", false);
+ test("{let x = 1 {5}}", 4 .. 4, " if", true);
test("a // b c #f()", 3 .. 4, "", false);
+ test("{\nf()\n//g(a)\n}", 6 .. 8, "", true);
+ test("{(1, 2)}", 1 .. 1, "while ", true);
// this appearantly works but the assertion fails.
- // test("a b c", 1 .. 1, "{[}", true);
+ test("a b c", 1 .. 1, "{[}", true);
// Test unclosed things.
test(r#"{"hi"}"#, 4 .. 5, "c", false);
@@ -571,7 +575,7 @@ mod tests {
test(r"{{let x = z}; a = 1} b", 6 .. 6, "//", false);
// these appearantly works but the assertion fails.
- // test(r#"a ```typst hello``` b"#, 16 .. 17, "", false);
- // test(r#"a ```typst hello```"#, 16 .. 17, "", true);
+ test(r#"a ```typst hello``` b"#, 16 .. 17, "", false);
+ test(r#"a ```typst hello```"#, 16 .. 17, "", true);
}
}