From adac566665b2f336442fc150694faf8d7d63b64f Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 14 Feb 2015 17:50:28 -0500 Subject: [PATCH] Unit Tests - Corrected expected output from the on-modify-misbehave4 test hook script. - Moved JSON syntax error details to debug output. --- src/Hooks.cpp | 3 ++- test/hooks.on-modify.t | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Hooks.cpp b/src/Hooks.cpp index bdacbbfa9..19249ffe3 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -441,7 +441,8 @@ void Hooks::assertValidJSON (const std::vector & input) const catch (const std::string& e) { context.error ("Hook Error: JSON syntax error in: " + *i); - context.error ("Hook Error: JSON " + e); + if (_debug) + context.error ("Hook Error: JSON " + e); throw 0; } diff --git a/test/hooks.on-modify.t b/test/hooks.on-modify.t index 652470d83..ca31750f9 100755 --- a/test/hooks.on-modify.t +++ b/test/hooks.on-modify.t @@ -117,7 +117,7 @@ class TestHooksOnModify(TestCase): code, out, err = self.t(("add", "foo")) code, out, err = self.t.runError(("1", "modify", "+tag")) - self.assertIn("ERROR SYNTACTICALLY WRONG JSON", err) + self.assertIn("Hook Error: JSON syntax error in: {\"}", err) self.t.hooks[hookname].assertTriggered() self.t.hooks[hookname].assertTriggeredCount(1) self.t.hooks[hookname].assertExitcode(0)