Skip to content

Commit

Permalink
Add tests for line continuations in literals
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
  • Loading branch information
Morriar committed Aug 13, 2020
1 parent f71f449 commit 3978ff4
Show file tree
Hide file tree
Showing 44 changed files with 156 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_0.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

'a\
b'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
s(:dstr,
s(:str, "a\
"),
s(:str, "b"))
6 changes: 6 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# typed: strict

<<-'HERE'
a\
b
HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
s(:dstr,
s(:str, "a\
"),
s(:str, "b
"))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_10.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%I{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s(:array,
s(:sym, :a\nb))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_11.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

:'a\
b'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
s(:dsym,
s(:str, "a\
"),
s(:str, "b"))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_12.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%s{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
s(:dsym,
s(:str, "a\
"),
s(:str, "b"))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_13.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

:"a\
b"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
s(:sym, :ab)
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_14.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

/a\
b/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
s(:regexp,
s(:str, "ab"),
s(:regopt, ""))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_15.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%r{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
s(:regexp,
s(:str, "ab"),
s(:regopt, ""))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_16.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%x{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s(:xstr,
s(:str, "ab"))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_17.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

`a\
b`
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s(:xstr,
s(:str, "ab"))
6 changes: 6 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_18.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# typed: strict

<<-`HERE`
a\
b
HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
s(:xstr,
s(:str, "ab
"))
6 changes: 6 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_19.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# typed: strict

<<-HERE
a\
b
HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s(:str, "ab
")
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%q{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
s(:dstr,
s(:str, "a\
"),
s(:str, "b"))
6 changes: 6 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_20.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# typed: strict

<<~HERE
a\
b
HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s(:str, "ab
")
6 changes: 6 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_21.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# typed: strict

<<~HERE
a\
b
HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s(:str, "a b
")
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_3.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

"a\
b"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
s(:str, "ab")
6 changes: 6 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_4.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# typed: strict

<<-"HERE"
a\
b
HERE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s(:str, "ab
")
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_5.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
s(:str, "ab")
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_6.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%Q{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
s(:str, "ab")
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_7.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%w{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
s(:array,
s(:str, "a
b"))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_8.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%W{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
s(:array,
s(:str, "a
b"))
4 changes: 4 additions & 0 deletions test/whitequark/test_slash_slash_n_escaping_in_literals_9.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# typed: strict

%i{a\
b}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s(:array,
s(:sym, :a\nb))

0 comments on commit 3978ff4

Please sign in to comment.