File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -254,7 +254,7 @@ module Punctuation
254
254
STRING_ESCAPE = %r{[\\ ][\\ /bfnrt]}
255
255
BLOCK_QUOTE = '"""'
256
256
ESCAPED_QUOTE = /\\ "/ ;
257
- STRING_CHAR = /#{ ESCAPED_QUOTE } |[^"\\ ]|#{ UNICODE_ESCAPE } |#{ STRING_ESCAPE } /
257
+ STRING_CHAR = /#{ ESCAPED_QUOTE } |[^"\\ \n \r ]|#{ UNICODE_ESCAPE } |#{ STRING_ESCAPE } /
258
258
QUOTED_STRING_REGEXP = %r{#{ QUOTE } (?:#{ STRING_CHAR } )* #{ QUOTE } }x
259
259
BLOCK_STRING_REGEXP = %r{
260
260
#{ BLOCK_QUOTE }
Original file line number Diff line number Diff line change 16
16
assert_equal expected_message , err . message
17
17
end
18
18
19
+ it "rejects newlines in single-quoted strings" do
20
+ assert_raises ( GraphQL ::ParseError ) {
21
+ GraphQL . parse ( "{ doStuff(arg: \"
22
+ abc\" ) }"
23
+ )
24
+ }
25
+ assert_raises ( GraphQL ::ParseError ) {
26
+ GraphQL . parse ( "{ doStuff(arg: \" \r abc\" ) }" )
27
+ }
28
+ end
29
+
19
30
describe "when there are no selections" do
20
31
it 'raises a ParseError' do
21
32
assert_raises ( GraphQL ::ParseError ) {
You can’t perform that action at this time.
0 commit comments