8000 Add test for spaces · ruby/rexml@96c1d9c · GitHub
[go: up one dir, main page]

Skip to content

Commit 96c1d9c

Browse files
committed
Add test for spaces
1 parent 635af12 commit 96c1d9c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/parse/test_entity_declaration.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,19 @@ def test_entity_value_and_notation_data_declaration
218218
DETAIL
219219
end
220220
end
221+
222+
def test_no_space
223+
exception = assert_raise(REXML::ParseException) do
224+
REXML::Document.new('<!DOCTYPE root [<!ENTITY valid-namePUBLIC"valid-pubid-literal""valid-system-literal"NDATAvalid-name>]>')
225+
end
226+
assert_equal(<<-DETAIL.chomp, exception.to_s)
227+
Malformed entity declaration
228+
Line: 1
229+
Position: 102
230+
Last 80 unconsumed characters:
231+
valid-namePUBLIC\"valid-pubid-literal\"\"valid-system-literal\"NDATAvalid-name>]>
232+
DETAIL
233+
end
221234
end
222235

223236
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PEDecl
@@ -397,6 +410,19 @@ def test_entity_value_and_notation_data_declaration
397410
DETAIL
398411
end
399412
end
413+
414+
def test_no_space
415+
exception = assert_raise(REXML::ParseException) do
416+
REXML::Document.new('<!DOCTYPE root [<!ENTITY %valid-nameSYSTEM"valid-system-literal">]>')
417+
end
418+
assert_equal(<<-DETAIL.chomp, exception.to_s)
419+
Malformed entity declaration
420+
Line: 1
421+
Position: 67
422+
Last 80 unconsumed characters:
423+
%valid-nameSYSTEM\"valid-system-literal\">]>
424+
DETAIL
425+
end
400426
end
401427

402428
def test_empty

0 commit comments

Comments
 (0)
0