From 2c39c91a65d69357cfbc35dd8079b3606d86bb70 Mon Sep 17 00:00:00 2001 From: Watson Date: Fri, 19 Jul 2024 17:15:15 +0900 Subject: [PATCH] Fix method scope in test in order to invoke the tests properly and fix exception message (#182) This PR includes following two fixes. 1. The `test_empty` and `test_linear_performance_gt` were defined as private method. Seems that test-unit runner does not invoke private methods even if the methods have `test_` prefix. 2. When parse malformed entity declaration, the exception might have the message about `NoMethodError`. The proper exception message will be contained by this fix. --- lib/rexml/parsers/baseparser.rb | 6 +++++- test/parse/test_entity_declaration.rb | 17 +++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/rexml/parsers/baseparser.rb b/lib/rexml/parsers/baseparser.rb index 5688c773..bbdcfc6c 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, " ]> +> ]> DETAIL end def test_linear_performance_gt seq = [10000, 50000, 100000, 150000, 200000] assert_linear_performance(seq, rehearsal: 10) do |n| - REXML::Document.new('' * n + '">') + REXML::Document.new('' * n + '">]>') end end end