Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
f7f353db
Commit
f7f353db
authored
Jun 21, 2016
by
Alexandre Duret-Lutz
Browse files
bin: improve range diagnostic
Fixes
#181
. * bin/common_range.cc: Here. * tests/core/ltlfilt.test: Add test case.
parent
205e2116
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/common_range.cc
View file @
f7f353db
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2014 Laboratoire de Recherche et
Développement de
// l'Epita (LRDE).
// Copyright (C) 2012, 2014
, 2016
Laboratoire de Recherche et
//
Développement de
l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
...
...
@@ -67,6 +67,9 @@ parse_range(const char* str, int missing_left, int missing_right)
// Parse the next integer.
char
*
end2
;
res
.
max
=
strtol
(
end
,
&
end2
,
10
);
if
(
str
==
end2
)
error
(
1
,
0
,
"invalid range '%s' "
"(should start with digits, dots, or colon)"
,
str
);
if
(
end
==
end2
)
error
(
1
,
0
,
"invalid range '%s' (missing end?)"
,
str
);
if
(
*
end2
)
...
...
tests/core/ltlfilt.test
View file @
f7f353db
...
...
@@ -344,4 +344,8 @@ test "`cat out`" = 'GF"a\"\\b"'
$ltlfilt
--
lbt
-
input
-
f
'G F "a\"\\b"'
-
l
>
out
test
"`cat out`"
=
'G F "a\"\\b"'
$ltlfilt
--
size
=
foo
=
2..3
2
>
stderr
&&
exit
1
grep
'invalid range.*should start with'
stderr
true
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment