dot: improve output to work around GraphViz bug

The related GraphViz issue is
https://gitlab.com/graphviz/graphviz/-/issues/2179

* spot/twaalgos/dot.cc: Avoid initial newline in title.
* NEWS: Mention the bug.
* tests/core/det.test, tests/core/dstar.test,
tests/core/neverclaimread.test, tests/python/automata-io.ipynb: Adjust
test cases.
This commit is contained in:
Alexandre Duret-Lutz 2022-01-11 22:19:20 +01:00
parent 78bcd9c453
commit 890423936f
6 changed files with 23 additions and 11 deletions

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2014-2021 Laboratoire de Recherche
// Copyright (C) 2011, 2012, 2014-2022 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
@ -626,7 +626,16 @@ namespace spot
std::string accstr = aut_->acc().name("d");
if (accstr.empty())
return;
os_ << nl_ << '[' << accstr << ']';
// If a name or an acceptance formula was printed,
// we need to add a newline before the human version of the acceptance.
//
// We used to always add that line, but on unnamed Büchi
// automata with double circles, this would (1) create an
// empty line, and (2) run into the following GraphViz bug:
// https://gitlab.com/graphviz/graphviz/-/issues/2179
if (name_ || !dcircles_)
os_ << nl_;
os_ << '[' << accstr << ']';
}
void