From 46c6397d5c647a700fb1817d0093471621d92a27 Mon Sep 17 00:00:00 2001 From: Watson Date: Thu, 1 Aug 2024 10:39:02 +0900 Subject: [PATCH] test: add performance tests for entity declaration --- test/parse/test_entity_declaration.rb | 33 +++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/test/parse/test_entity_declaration.rb b/test/parse/test_entity_declaration.rb index 30aad48a..81d95b58 100644 --- a/test/parse/test_entity_declaration.rb +++ b/test/parse/test_entity_declaration.rb @@ -518,10 +518,39 @@ def test_empty DETAIL end - def test_linear_performance_gt + def test_linear_performance_entity_value_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 + + def test_linear_performance_entity_value_gt_right_bracket + seq = [10000, 50000, 100000, 150000, 200000] + assert_linear_performance(seq, rehearsal: 10) do |n| + REXML::Document.new("]" * n + + "\">]>") + end + end + + def test_linear_performance_system_literal_in_system_gt_right_bracket + seq = [10000, 50000, 100000, 150000, 200000] + assert_linear_performance(seq, rehearsal: 10) do |n| + REXML::Document.new("]" * n + + "\">]>") + end + end + + def test_linear_performance_system_literal_in_public_gt_right_bracket + seq = [10000, 50000, 100000, 150000, 200000] + assert_linear_performance(seq, rehearsal: 10) do |n| + REXML::Document.new("]" * n + + "\">]>") end end end