* src/ltltest/tostring.test: Simplify with set -e. Move the
description of the test ... * src/ltltest/tostring.cc: ... here, where it is actually coded. * src/ltltest/lunabbrev.test, src/ltltest/tunabbrev.test, src/ltltest/nenoform.test, src/ltltest/tunenoform.test: Simplify with set -e.
This commit is contained in:
parent
03e893b23d
commit
d17a86e87d
7 changed files with 115 additions and 130 deletions
|
|
@ -16,13 +16,16 @@ main(int argc, char **argv)
|
|||
{
|
||||
if (argc != 2)
|
||||
syntax(argv[0]);
|
||||
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
spot::ltl::formula* f1 = spot::ltl::parse(argv[1], p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, argv[1], p1))
|
||||
return 2;
|
||||
|
||||
// The string generated from an abstract tree should be parsable
|
||||
// again.
|
||||
|
||||
std::ostringstream os;
|
||||
spot::ltl::to_string(*f1, os);
|
||||
std::cout << os.str() << std::endl;
|
||||
|
|
@ -32,14 +35,18 @@ main(int argc, char **argv)
|
|||
if (spot::ltl::format_parse_errors(std::cerr, os.str(), p1))
|
||||
return 2;
|
||||
|
||||
// This second abstract tree should be equal to the first.
|
||||
|
||||
if (! equals(f1, f2))
|
||||
return 1;
|
||||
|
||||
// It should also map to the same string.
|
||||
|
||||
std::ostringstream os2;
|
||||
spot::ltl::to_string(*f2, os2);
|
||||
std::cout << os2.str() << std::endl;
|
||||
|
||||
if (os2.str() != os.str())
|
||||
return 1;
|
||||
|
||||
if (! equals(f1, f2))
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue