Commit 22427019 authored by Akim Demaille's avatar Akim Demaille
Browse files

tests: CHECK_EQUIV calls proper itself

* tests/python/efsm.py, tests/python/product.py: So don't do it.
parent 4334313b
......@@ -125,6 +125,19 @@ crange should not feature size and empty if !VCSN_DEBUG.
It does not work for weighted ratexps.
* Improvements
** are-equivalent
V1 was calling letterize and proper, so it was more general than we are now.
This should be fixed. One question is whether proper should do something
when the automaton is already proper. We have a problem, though, when the
output type is not the same as the input type (e.g., LAN -> LAL). Maybe
proper_here should do that. But then, what should are-equivalent do?
Always call proper, even if the automaton is already proper?
FWIW, V1 was really performing proper when proper is called, it does not
check whether is_proper first. However are-equivalent actually uses
a.realtime() = a.letterize().proper(), and a.realtime() checks first if the
automaton is not already realtime.
** eliminate-state
Support several arguments.
......
......@@ -143,9 +143,9 @@ def CHECK_EQUIV(a1, a2):
num = 10
a1 = a1.strip()
a2 = a2.strip()
if str(a1.context()).startswith('lan'):
if 'lan' in str(a1.context()):
a1 = a1.proper()
if str(a2.context()).startswith('lan'):
if 'lan' in str(a2.context()):
a2 = a2.proper()
# Cannot compare automata on Zmin.
......
......@@ -36,7 +36,7 @@ def check(aut, fefsm):
CHECK_EQ(aut, aut2)
CHECK_EQ(efsm, aut2.format('efsm'))
else:
CHECK_EQUIV(aut.proper(), aut2.proper())
CHECK_EQUIV(aut, aut2)
# Check that OpenFST accepts and reproduces our EFSM files.
if have_ofst:
......@@ -44,7 +44,7 @@ def check(aut, fefsm):
if aut.is_standard():
CHECK_EQ(aut, aut3)
else:
CHECK_EQUIV(aut.proper(), aut3.proper())
CHECK_EQUIV(aut, aut3)
else:
SKIP('OpenFST is missing')
......
......@@ -381,7 +381,7 @@ res = r'''digraph
25 -> 10 [label = "\\e", color = DimGray]
}'''
CHECK_EQ(res, str(lhs & rhs))
CHECK_EQUIV(vcsn.automaton(res).proper(),
CHECK_EQUIV(vcsn.automaton(res),
vcsn.context("lal_char(b)_b").ratexp("b*").standard())
third = vcsn.context('lan_char(bcd)_b').ratexp('(b+c+d)*').thompson()
......@@ -603,7 +603,7 @@ res = r'''digraph
91 -> 40 [label = "\\e", color = DimGray]
}'''
CHECK_EQ(res, str(lhs & rhs & third))
CHECK_EQUIV(vcsn.automaton(res).proper(),
CHECK_EQUIV(vcsn.automaton(res),
vcsn.context("lal_char(b)_b").ratexp("b*").standard())
###############################################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment