From df3e0eb4864965bc0800e36dbb99dc25de743283 Mon Sep 17 00:00:00 2001 From: Aaron Date: Wed, 7 Jan 2009 10:35:17 -0500 Subject: Added token parse failure test --- dbtests/jsobjtests.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'dbtests') diff --git a/dbtests/jsobjtests.cpp b/dbtests/jsobjtests.cpp index f688ab336ce..e5b3496270f 100644 --- a/dbtests/jsobjtests.cpp +++ b/dbtests/jsobjtests.cpp @@ -777,6 +777,14 @@ namespace FromJsonTests { } }; + class Malformed { + public: + void run() { + string bad( "{" ); + ASSERT_EXCEPTION( fromjson( bad ), MsgAssertionException ); + } + }; + } // namespace FromJsonTests class All : public UnitTest::Suite { @@ -840,6 +848,7 @@ public: add< FromJsonTests::Regex >(); add< FromJsonTests::RegexEscape >(); add< FromJsonTests::RegexWithQuotes >(); + add< FromJsonTests::Malformed >(); } }; -- cgit v1.2.1