aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/StandardCompiler.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp
index e48624e5..8da536d8 100644
--- a/test/libsolidity/StandardCompiler.cpp
+++ b/test/libsolidity/StandardCompiler.cpp
@@ -154,6 +154,42 @@ BOOST_AUTO_TEST_CASE(no_sources)
BOOST_CHECK(containsError(result, "JSONError", "No input sources specified."));
}
+BOOST_AUTO_TEST_CASE(no_sources_empty_object)
+{
+ char const* input = R"(
+ {
+ "language": "Solidity",
+ "sources": {}
+ }
+ )";
+ Json::Value result = compile(input);
+ BOOST_CHECK(containsError(result, "JSONError", "No input sources specified."));
+}
+
+BOOST_AUTO_TEST_CASE(no_sources_empty_array)
+{
+ char const* input = R"(
+ {
+ "language": "Solidity",
+ "sources": []
+ }
+ )";
+ Json::Value result = compile(input);
+ BOOST_CHECK(containsError(result, "JSONError", "\"sources\" is not a JSON object."));
+}
+
+BOOST_AUTO_TEST_CASE(sources_is_array)
+{
+ char const* input = R"(
+ {
+ "language": "Solidity",
+ "sources": ["aa", "bb"]
+ }
+ )";
+ Json::Value result = compile(input);
+ BOOST_CHECK(containsError(result, "JSONError", "\"sources\" is not a JSON object."));
+}
+
BOOST_AUTO_TEST_CASE(smoke_test)
{
char const* input = R"(