From 137ef78e9a13c9b120c37fc7dcb42eaa1a8f0cf0 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 19 Apr 2017 17:41:55 +0100 Subject: Trigger cases by the JSON (and not string) interface --- test/libsolidity/StandardCompiler.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'test/libsolidity') 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")); -- cgit