summaryrefslogtreecommitdiff
path: root/src/source.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2021-11-09 13:34:23 +0100
committerMartin Haug <mhaug@live.de>2021-11-09 13:34:23 +0100
commit91f2f97572c64d7eb25c88ad0ebb18192cf8eddf (patch)
tree62639ca45c156cd7c1a5c473c5936c96ccf014d1 /src/source.rs
parent7a631d8b09bbffa8c7d90a1038d986876370ea7a (diff)
Multiple replacements, escapes
Diffstat (limited to 'src/source.rs')
-rw-r--r--src/source.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/source.rs b/src/source.rs
index 3117f5b6..797e815b 100644
--- a/src/source.rs
+++ b/src/source.rs
@@ -500,6 +500,8 @@ mod tests {
// Test simple replacements.
test("hello world", 6 .. 11, "wankers", true);
+ test("a d e", 1 .. 3, " b c d", true);
+ test("a #f() e", 1 .. 6, " b c d", false);
test("{(0, 1, 2)}", 5 .. 6, "11pt", true);
test("= A heading", 3 .. 3, "n evocative", true);
test(
@@ -546,6 +548,8 @@ mod tests {
test("x = y", 2 .. 2, "+ y \n ", false);
test("abc\n= a heading", 3 .. 4, "\nsome more test\n\n", true);
test("abc\n= a heading", 3 .. 4, "\nnot ", false);
+ test("hey #myfriend", 4 .. 4, "\\", false);
+ test("hey #myfriend", 4 .. 4, "\\", true);
// Test type invariants.
test("#for x in array {x}", 16 .. 19, "[#x]", true);