blob: 32d2f36198fadf4462e4755260afbd28e76a80fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# -*- tcl -*-
# finite_automaton.test: tests for the grammar::fa container.
#
# Copyright (c) 2004-2007 by Andreas Kupries <andreas_kupries@users.sourceforge.net>
#
# RCS: @(#) $Id: fa_is_epsfree.test,v 1.4 2007/04/12 03:43:14 andreas_kupries Exp $
# -------------------------------------------------------------------------
foreach {n code result} {
00 x 1
01 x- 1
02 xe 0
03 xy 1
04 xy- 1
05 xye 0
06 xyee 0
07 xye- 0
08 xy-- 1
09 xy-= 1
10 xyz/ee 0
11 xyz/e- 0
12 xyz/-- 1
13 xyz/-= 1
14 xyz|ee 0
15 xyz|e- 0
16 xyz|-- 1
17 xyz|-= 1
18 xyz+eee 0
19 xyz+ee- 0
20 xyz+e-- 0
21 xyz+e-= 0
22 xyz+--- 1
23 xyz+--= 1
24 xyz+-=_ 1
25 xyz&eee 0
26 xyz&ee- 0
27 xyz&e-- 0
28 xyz&e-= 0
29 xyz&--- 1
30 xyz&--= 1
31 xyz&-=_ 1
32 xyz!ee 0
33 xyz!e- 0
34 xyz!-- 1
35 xyz!-= 1
36 xyz!-e 0
} {
test fa-is-${setimpl}-epsilonfree-1.${n}.$code {is epsilon free} {
grammar::fa a
gen $code
set res [a is epsilon-free]
a destroy
set res
} $result ; # {}
}
# -------------------------------------------------------------------------
::tcltest::cleanupTests
|