diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-20 00:41:55 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-21 02:38:00 +0800 |
commit | 137ef78e9a13c9b120c37fc7dcb42eaa1a8f0cf0 (patch) | |
tree | f2718ffd3a6514767086788869e396e55b0b4294 | |
parent | 10ec334f749c62decb0bda8ab85399d0e7d45338 (diff) | |
download | dexon-solidity-137ef78e9a13c9b120c37fc7dcb42eaa1a8f0cf0.tar.gz dexon-solidity-137ef78e9a13c9b120c37fc7dcb42eaa1a8f0cf0.tar.zst dexon-solidity-137ef78e9a13c9b120c37fc7dcb42eaa1a8f0cf0.zip |
Trigger cases by the JSON (and not string) interface
-rw-r--r-- | test/libsolidity/StandardCompiler.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp index 63124c83..bd180b34 100644 --- a/test/libsolidity/StandardCompiler.cpp +++ b/test/libsolidity/StandardCompiler.cpp @@ -87,7 +87,17 @@ BOOST_AUTO_TEST_SUITE(StandardCompiler) BOOST_AUTO_TEST_CASE(assume_object_input) { - Json::Value result = compile(""); + Json::Value result; + + /// Use the native JSON interface of StandardCompiler to trigger these + solidity::StandardCompiler compiler; + result = compiler.compile(Json::Value()); + BOOST_CHECK(containsError(result, "JSONError", "Input is not a JSON object.")); + result = compiler.compile(Json::Value("INVALID")); + BOOST_CHECK(containsError(result, "JSONError", "Input is not a JSON object.")); + + /// Use the string interface of StandardCompiler to trigger these + result = compile(""); BOOST_CHECK(containsError(result, "JSONError", "* Line 1, Column 1\n Syntax error: value, object or array expected.\n")); result = compile("invalid"); BOOST_CHECK(containsError(result, "JSONError", "* Line 1, Column 1\n Syntax error: value, object or array expected.\n")); |