added the first regression test suite set for the new expression support

* Makefile.am result/expr/base test/expr/base: added the first
  regression test suite set for the new expression support
Daniel
This commit is contained in:
Daniel Veillard 2005-08-22 12:58:05 +00:00
parent 465a000b10
commit 355a023866
4 changed files with 191 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Mon Aug 22 14:57:13 CEST 2005 Daniel Veillard <daniel@veillard.com>
* Makefile.am result/expr/base test/expr/base: added the first
regression test suite set for the new expression support
Mon Aug 22 13:49:18 CEST 2005 Daniel Veillard <daniel@veillard.com> Mon Aug 22 13:49:18 CEST 2005 Daniel Veillard <daniel@veillard.com>
* valid.c: fixed an uninitialized variable * valid.c: fixed an uninitialized variable

View File

@ -822,6 +822,21 @@ Regexptests: testRegexp$(EXEEXT)
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
rm result.$$name ; \ rm result.$$name ; \
fi ; fi ; done) fi ; fi ; done)
@echo "## Formal expresssions regression tests"
-@(for i in $(srcdir)/test/expr/* ; do \
name=`basename $$i`; \
if [ ! -d $$i ] ; then \
if [ ! -f $(srcdir)/result/expr/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i > $(srcdir)/result/expr/$$name; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/expr/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
Automatatests: testAutomata$(EXEEXT) Automatatests: testAutomata$(EXEEXT)
@(echo > .memdump) @(echo > .memdump)

85
result/expr/base Normal file
View File

@ -0,0 +1,85 @@
Expression: a
Subexp: a => accept, Ok
Subexp: a | a => accept, Ok
Subexp: b => reject, Ok
Expression: a|b
Subexp: a => accept, Ok
Subexp: b => accept, Ok
Subexp: a | b => accept, Ok
Subexp: a{0} => reject, Ok
Subexp: b{0} => reject, Ok
Expression: a | b | a
Subexp: a => accept, Ok
Subexp: b => accept, Ok
Subexp: a | b => accept, Ok
Subexp: b | a => accept, Ok
Subexp: a | b | b => accept, Ok
Subexp: a | b | a => accept, Ok
Subexp: b | a | b => accept, Ok
Expression: a,a
Subexp: a,a => accept, Ok
Subexp: a => reject, Ok
Subexp: a,a,a => reject, Ok
Expression: a{0,3}
Subexp: a{3} => accept, Ok
Subexp: a => accept, Ok
Subexp: a,a,a => accept, Ok
Subexp: a{1,3} => accept, Ok
Expression: (a|b){0,4}
Subexp: a => accept, Ok
Subexp: b => accept, Ok
Subexp: a,b => accept, Ok
Subexp: a,b,a,b => accept, Ok
Subexp: b,a,b,a,b => reject, Ok
Subexp: b,a{1,3} => accept, Ok
Subexp: a{1,3},b => accept, Ok
Subexp: a{1,3},b,a => reject, Ok
Subexp: a{1,4},b => reject, Ok
Subexp: a{0,5} => reject, Ok
Subexp: (b|a){0,4} => accept, Ok
Subexp: (b|a){0,4},a => reject, Ok
Subexp: (a,b){0,2} => accept, Ok
Subexp: (a,b){0,1},b => accept, Ok
Expression: a*
Subexp: a => accept, Ok
Subexp: a? => accept, Ok
Subexp: a+ => accept, Ok
Subexp: a* => accept, Ok
Subexp: a{0} => accept, Ok
Expression: a+
Subexp: a => accept, Ok
Subexp: a? => reject, Ok
Subexp: a+ => accept, Ok
Subexp: a* => reject, Ok
Subexp: a?,a => accept, Ok
Subexp: a,a* => accept, Ok
Subexp: a*,a => accept, Ok
Subexp: a?,a*,a => accept, Ok
Subexp: a*,a?,a => accept, Ok
Expression: (a|b)*
Subexp: a => accept, Ok
Subexp: b => accept, Ok
Subexp: a,b => accept, Ok
Subexp: a,b,a,b => accept, Ok
Subexp: (b|a){0,4} => accept, Ok
Subexp: (b|a){0,4},a => accept, Ok
Subexp: a* => accept, Ok
Subexp: b* => accept, Ok
Subexp: (a|b)* => accept, Ok
Subexp: a{1,3} => accept, Ok
Subexp: b,a{1,3} => accept, Ok
Subexp: a{1,3},b => accept, Ok
Subexp: a*,(a|b)* => accept, Ok
Subexp: a*,b{2,5} => accept, Ok
Subexp: a*,(a|b)*,b{2,5} => accept, Ok
Expression: (a|b)+,(c|d)
Subexp: a+,c => accept, Ok
Subexp: a*,c => reject, Ok
Subexp: a,c => accept, Ok
Subexp: a,b*,a*,c => accept, Ok
Expression: (a|b),(a|c){0,100}
Subexp: a{0,100},(a|c) => accept, Ok
Subexp: a{0,101},(a|c) => reject, Ok
Expression: (a, ((b, c, d){0,5}, e{0,1}){0,4}, f)
Subexp: (a, b, (c, d, b){2,3}, c, d, e, f) => accept, Ok
Ops: 0 nodes, 205 cons

86
test/expr/base Normal file
View File

@ -0,0 +1,86 @@
=>a
1 a
1 a | a
0 b
=>a|b
1 a
1 b
1 a | b
0 a{0}
0 b{0}
=>a | b | a
1 a
1 b
1 a | b
1 b | a
1 a | b | b
1 a | b | a
1 b | a | b
=>a,a
1 a,a
0 a
0 a,a,a
=>a{0,3}
1 a{3}
1 a
1 a,a,a
1 a{1,3}
=>(a|b){0,4}
1 a
1 b
1 a,b
1 a,b,a,b
0 b,a,b,a,b
1 b,a{1,3}
1 a{1,3},b
0 a{1,3},b,a
0 a{1,4},b
0 a{0,5}
1 (b|a){0,4}
0 (b|a){0,4},a
1 (a,b){0,2}
1 (a,b){0,1},b
=> a*
1 a
1 a?
1 a+
1 a*
1 a{0}
=> a+
1 a
0 a?
1 a+
0 a*
1 a?,a
1 a,a*
1 a*,a
1 a?,a*,a
1 a*,a?,a
=>(a|b)*
1 a
1 b
1 a,b
1 a,b,a,b
1 (b|a){0,4}
1 (b|a){0,4},a
1 a*
1 b*
1 (a|b)*
1 a{1,3}
1 b,a{1,3}
1 a{1,3},b
1 a*,(a|b)*
1 a*,b{2,5}
1 a*,(a|b)*,b{2,5}
=>(a|b)+,(c|d)
1 a+,c
0 a*,c
1 a,c
1 a,b*,a*,c
# more complex
=>(a|b),(a|c){0,100}
1 a{0,100},(a|c)
0 a{0,101},(a|c)
# the example from cmsmcq at extreme markup 05
=>(a, ((b, c, d){0,5}, e{0,1}){0,4}, f)
1 (a, b, (c, d, b){2,3}, c, d, e, f)