Skip to content

Commit

Permalink
Add some more string escaping specs
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Dec 2, 2013
1 parent acd2ae2 commit 073b738
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/cli/lexer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@
expect_parsed_string("'foo\\tbar'").to eq("foo\\tbar")
end

it "single-quoted strings can escape \\ and \' characters" do
expect_parsed_string("'a\\\\b\\'c'").to eq("a\\b'c")
end

it "does escape characters using double-quoted strings" do
expect_parsed_string("\"foo\"").to eq("foo")
expect_parsed_string("\"foo\\tbar\"").to eq("foo\tbar")
expect_parsed_string("\"\\\"foo\"").to eq("\"foo")
end
end
end

0 comments on commit 073b738

Please sign in to comment.