From 75ca8ebb9fa276e7b795eb3a77b6346423aac957 Mon Sep 17 00:00:00 2001 From: Takahiro Ueda Date: Fri, 17 Mar 2017 16:04:44 +0100 Subject: [PATCH] [test] Test case for numactiveexprs_ and activeexprnames_ --- check/Makefile.am | 2 +- check/check.rb | 2 +- check/features.frm | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/check/Makefile.am b/check/Makefile.am index 928defbc..811b34bc 100644 --- a/check/Makefile.am +++ b/check/Makefile.am @@ -19,4 +19,4 @@ TESTS_ENVIRONMENT = \ $(SHELL) TESTS = check-help.sh endif -EXTRA_DIST = check-help.sh check.rb examples.frm fixes.frm +EXTRA_DIST = check-help.sh check.rb examples.frm features.frm fixes.frm diff --git a/check/check.rb b/check/check.rb index cc9b4e7b..28a4d962 100755 --- a/check/check.rb +++ b/check/check.rb @@ -452,7 +452,7 @@ def return_value # The verbatim result keeping line breaks and whitespaces. # Must be in the default output format. def exact_result(exprname, index = -1) - matches = @stdout.scan(/^[ \t]+#{exprname}\s*=(.+?);/m) + matches = @stdout.scan(/^[ \t]+#{Regexp.escape(exprname)}\s*=(.+?);/m) return matches[index].first if !matches.empty? && !matches[index].nil? "" end diff --git a/check/features.frm b/check/features.frm index 9e8f3734..b09b0ff6 100644 --- a/check/features.frm +++ b/check/features.frm @@ -521,3 +521,20 @@ P; assert succeeded? assert result("ZERO") =~ expr("0") *--#] Issue137_4 : +*--#[ Issue175 : +* Loop over currently active expressions #175 +L FF = 1; +L [FF|a,b] = 1; +L [FF,[GG]] = 1; +#do e={`activeexprnames_'} + L `e' = `e' + 1; +#enddo +L N = `numactiveexprs_'; +P; +.end +assert succeeded? +assert result("FF") =~ expr("2") +assert result("[FF|a,b]") =~ expr("2") +assert result("[FF,[GG]]") =~ expr("2") +assert result("N") =~ expr("3") +*--#] Issue175 :