#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
# Spot is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Spot is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
. ./defs
set -e
expecterr()
{
cat >$1.exp
../../bin/autfilt --hoa "$@" 2>$1.err >$1.out && exit 1
test $? = 2
cat $1.err
diff $1.err $1.exp
}
expectok()
{
cat >$1.exp
../../bin/autfilt --hoa "$@" >$1.out
test $? = 0
cat $1.out
diff $1.out $1.exp
}
cat >input <input <input <input <input <input <input <input <input <input <input<input<input<input <input <input <stderr && exit 1
cat stderr
diff stderr input.exp
cat >expected <input <input < goto accept_all
:: ((a)) -> goto T0_init
fi;
accept_all:
skip
}
never {
start: if :: false -> goto T0 fi;
T0: false
}
EOF
expectok input <input <input <input <expected <stderr && exit 1
cat stderr
diff stderr input.exp
diff expected input.out
# Error recovery
cat >input <input <input <output.err
grep 'foob:1.1: Cannot open file foob' output.err
# Make sure we can read multiple automata from stdin
../../bin/ltl2tgba 'a U b' 'GFa' --hoa | grep -v '^name:' > input
../../bin/autfilt --hoa < input | ../../bin/autfilt --hoa > output
diff input output
# Parse something in debug mode, to exercise the %printer
cat >input < output.err
grep -- "--BODY--" output.err
grep "identifier.*v1" output.err
# This was generated by
# randaut -n 10 -Hl 3 -d 0.055 --seed=3 | fmt
cat > input <input <