Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jaynetics committed May 14, 2023
1 parent 8eb599a commit 7413c52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/scanner/escapes_spec.rb
Expand Up @@ -43,6 +43,14 @@
include_examples 'scan', 'ab\$cd', 1 => [:escape, :eol, '\$', 2, 4]
include_examples 'scan', 'ab\[cd', 1 => [:escape, :set_open, '\[', 2, 4]

# escaped whitespace in x-mode
include_examples 'scan', /a\ b/x, 0 => [:literal, :literal, 'a', 0, 1],
1 => [:escape, :literal, '\ ', 1, 3],
2 => [:literal, :literal, 'b', 3, 4]
# newline literals can't be escaped in x-mode, c.f. https://bugs.ruby-lang.org/issues/19639
include_examples 'scan', /a\
b/x, 0 => [:literal, :literal, 'ab', 0, 2]

# Meta/control espaces
#
# After the following fix in Ruby 3.1, a Regexp#source containing meta/control
Expand Down

0 comments on commit 7413c52

Please sign in to comment.