From 93ec28f68b6c04f6c31bc8e117b586ef1a469331 Mon Sep 17 00:00:00 2001 From: Watson Date: Fri, 19 Jul 2024 14:36:19 +0900 Subject: [PATCH] Raise ParseException with proper message --- lib/rexml/parsers/baseparser.rb | 6 +++++- test/parse/test_entity_declaration.rb | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb index 5688c773..87c904cf 100644 --- a/lib/rexml/parsers/baseparser.rb +++ b/lib/rexml/parsers/baseparser.rb @@ -318,7 +318,11 @@ def pull_event raise REXML::ParseException.new( "Bad ELEMENT declaration!", @source ) if md.nil? return [ :elementdecl, " INTERNAL_SUBSET end + assert_equal(<<-DETAIL.chomp, exception.to_s) +Malformed entity declaration +Line: 5 +Position: 70 +Last 80 unconsumed characters: +> ]> + DETAIL end def test_linear_performance_gt