work around diagnostic changes in Bison 3.6

Bison <3.6 used to complain about "$undefined", while Bison >=3.6 now
write "invalid token".

* tests/core/parseaut.test, tests/core/parseerr.test,
tests/core/sugar.test: Adjust expected diagnostics to match Bison pre
and post 3.6.
This commit is contained in:
Alexandre Duret-Lutz 2020-05-24 14:05:46 +02:00
parent a395309f4b
commit 1752b18f14
3 changed files with 18 additions and 14 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2018 Laboratoire de Recherche et Développement de
# Copyright (C) 2014-2018, 2020 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
@ -31,7 +31,9 @@ expecterr()
# If autfilt is compiled statically, the '.../lt-' parse of
# its name is not stripped, and the error message show the
# full path.
sed 's:^\.\./\.\./bin/::' $1.err-t >$1.err
# Also work around differences between Bison >=3.6 (invalid token)
# end Bison <3.6 ($undefined).
sed 's:^\.\./\.\./bin/::;s/[$]undefined/invalid token/' $1.err-t >$1.err
cat $1.err
diff $1.err $1.exp
}
@ -1226,21 +1228,22 @@ garbage
EOF
se='syntax error, unexpected' # this is just to keep lines short
undefined='invalid token'
expecterr input <<EOF
input:8.11: $se identifier, expecting integer or '}'
input:8.10-12: ignoring this invalid acceptance set
input:11.2: $se identifier
input:11.1-3: ignoring this invalid label
input:21.5-7: $se string, expecting integer
input:25.1: $se \$undefined
input:25.1: $se $undefined
input:32.1-5: $se header name, expecting --END-- or State:
input:28.1-8: initial state 0 has no definition
input:25.1-12: leading garbage was ignored
input:37.1: $se 't'
input:43.1: $se \$undefined
input:56.1: $se \$undefined, expecting State: or end of DSTAR automaton
input:43.1: $se $undefined
input:56.1: $se $undefined, expecting State: or end of DSTAR automaton
input:37.1-39.21: leading garbage was ignored
input:81.1: $se \$undefined
input:81.1: $se $undefined
autfilt: failed to read automaton from input
EOF