Skip to content

Commit 17ad82d

Browse files
committed
Add tests for quote doubling lexing
1 parent 07822b1 commit 17ad82d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/LexTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,17 @@ public function testStrings(){
6868

6969
$this->lex_test("foo \"bar\" baz", array("foo", "\"bar\"", "baz"));
7070
$this->lex_test("foo \"bar \\\" baz\" qux", array("foo", "\"bar \\\" baz\"", "qux"));
71+
72+
# a `''` inside a string quoted with `'`
73+
$this->lex_test("'hel''lo'", array("'hel''lo'"));
74+
75+
# a `""` inside a string quoted with `"`
76+
$this->lex_test('"hel""lo"', array('"hel""lo"'));
77+
78+
# a `''` inside a string quoted with `"`
79+
$this->lex_test("\"hel''lo\"", array("\"hel''lo\""));
80+
81+
# a `""` inside a string quoted with `'`
82+
$this->lex_test('\'hel""lo\'', array('\'hel""lo\''));
7183
}
7284
}

0 commit comments

Comments
 (0)