Commit 89b9cc5f authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

lbttparse: make sure we parse wring2lbtt's output

* src/tgbaalgos/lbtt.cc: Do not expect a new line after the number of
acceptance conditions.
* src/tgbatest/lbttparse.test: Add a test case.
parent 676ab41f
......@@ -325,9 +325,13 @@ namespace spot
unsigned num_acc = 0;
is >> num_acc;
std::string rest;
std::getline(is, rest);
if (rest[0] == 't' || rest[0] == 'T')
int type;
type = is.peek();
if (type == 't' || type == 'T' || type == 's' || type == 'S')
type = is.get();
if (type == 't' || type == 'T')
return lbtt_read_tgba(num_states, num_acc, is, error, dict,
env, envacc);
else
......
......@@ -65,3 +65,19 @@ test "`cat size | sed -n 's/states: //p'`" = 4
test "`cat size | sed -n 's/transitions: //p'`" = 6
# This kind of output is returned by wring2lbtt, on the same formula.
# (Newer versions of LBTT reject this input with missing new lines.)
cat >wring2lbtt <<EOF
4 1 0 1 -1 1 p0
2 p1
-1 1 0 -1 1 p0
2 p1
-1 2 0 0 -1 3 t
-1 3 0 0 -1 3 t
-1
EOF
run 0 ../ltl2tgba -ks -XL wring2lbtt > size
test "`cat size | sed -n 's/states: //p'`" = 4
test "`cat size | sed -n 's/transitions: //p'`" = 6
Markdown is supported
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