aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-14 09:55:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-14 09:55:52 +0200
commit6c3d3f62f8560cbb8d1e983a8dd8cc98266bfe37 (patch)
tree54a6670df9a8e4189aa62a06e38bd51f8481dc58
parent824024117221263370c3f440d86d843630a2a82e (diff)
Tweak assert directive diagnostics
-rw-r--r--build2/parser.cxx7
-rw-r--r--tests/directive/assert.testscript2
2 files changed, 5 insertions, 4 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx
index c26f0a5..731ef46 100644
--- a/build2/parser.cxx
+++ b/build2/parser.cxx
@@ -1979,10 +1979,11 @@ namespace build2
: names ());
diag_record dr (fail (al));
- dr << "assertion failed";
- if (!ns.empty ())
- dr << ": " << ns;
+ if (ns.empty ())
+ dr << "assertion failed";
+ else
+ dr << ns;
}
void parser::
diff --git a/tests/directive/assert.testscript b/tests/directive/assert.testscript
index ffe6aa0..2a3f99e 100644
--- a/tests/directive/assert.testscript
+++ b/tests/directive/assert.testscript
@@ -18,7 +18,7 @@ EOE
: false-desc
:
$* <'assert false bad thing happened: (a == b)' 2>>EOE != 0
-<stdin>:1:1: error: assertion failed: bad thing happened: false
+<stdin>:1:1: error: bad thing happened: false
EOE
: invalid