Skip to content

Commit

Permalink
[test] Test case for numactiveexprs_ and activeexprnames_
Browse files Browse the repository at this point in the history
  • Loading branch information
tueda committed Mar 17, 2017
1 parent c91c1ed commit 75ca8eb
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion check/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion check/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions check/features.frm
Original file line number Diff line number Diff line change
Expand Up @@ -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 :

0 comments on commit 75ca8eb

Please sign in to comment.