summaryrefslogtreecommitdiff
path: root/dbtests
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-01-07 10:35:17 -0500
committerAaron <aaron@10gen.com>2009-01-07 10:35:17 -0500
commitdf3e0eb4864965bc0800e36dbb99dc25de743283 (patch)
tree9376fbcbe4f9086d99b85579f85d8153caa64781 /dbtests
parent6f1813327761b1c3dbcd66ed840b27de2e60be20 (diff)
downloadmongo-df3e0eb4864965bc0800e36dbb99dc25de743283.tar.gz
Added token parse failure test
Diffstat (limited to 'dbtests')
-rw-r--r--dbtests/jsobjtests.cpp9
1 files changed, 9 insertions, 0 deletions
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 >();
}
};