Skip to content

Commit 073b738

Browse files
committed
Add some more string escaping specs
1 parent acd2ae2 commit 073b738

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/cli/lexer_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@
3838
expect_parsed_string("'foo\\tbar'").to eq("foo\\tbar")
3939
end
4040

41+
it "single-quoted strings can escape \\ and \' characters" do
42+
expect_parsed_string("'a\\\\b\\'c'").to eq("a\\b'c")
43+
end
44+
4145
it "does escape characters using double-quoted strings" do
4246
expect_parsed_string("\"foo\"").to eq("foo")
4347
expect_parsed_string("\"foo\\tbar\"").to eq("foo\tbar")
48+
expect_parsed_string("\"\\\"foo\"").to eq("\"foo")
4449
end
4550
end
4651
end

0 commit comments

Comments
 (0)