aboutsummaryrefslogtreecommitdiffstats
path: root/test/cmdlineTests
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-12-11 22:47:19 +0800
committerLeonardo Alt <leo@ethereum.org>2018-12-13 00:32:42 +0800
commit8cd2ac84622185a59ee61439289d1defe58dec99 (patch)
treee3cbc9288e2066d866255bb771204b7b634973a6 /test/cmdlineTests
parent1c8c8734654a4bea8270beff7e1a295323002af3 (diff)
downloaddexon-solidity-8cd2ac84622185a59ee61439289d1defe58dec99.tar.gz
dexon-solidity-8cd2ac84622185a59ee61439289d1defe58dec99.tar.zst
dexon-solidity-8cd2ac84622185a59ee61439289d1defe58dec99.zip
Disallow unknown JSON keys in standard-json
Diffstat (limited to 'test/cmdlineTests')
-rw-r--r--test/cmdlineTests/standard.json10
-rw-r--r--test/cmdlineTests/standard.json.exit1
-rw-r--r--test/cmdlineTests/standard.json.stdout1
-rw-r--r--test/cmdlineTests/standard_wrong_key_auxiliary_input.json14
-rw-r--r--test/cmdlineTests/standard_wrong_key_auxiliary_input.json.exit1
-rw-r--r--test/cmdlineTests/standard_wrong_key_auxiliary_input.json.stdout1
-rw-r--r--test/cmdlineTests/standard_wrong_key_metadata.json22
-rw-r--r--test/cmdlineTests/standard_wrong_key_metadata.json.exit1
-rw-r--r--test/cmdlineTests/standard_wrong_key_metadata.json.stdout1
-rw-r--r--test/cmdlineTests/standard_wrong_key_optimizer.json22
-rw-r--r--test/cmdlineTests/standard_wrong_key_optimizer.json.exit1
-rw-r--r--test/cmdlineTests/standard_wrong_key_optimizer.json.stdout1
-rw-r--r--test/cmdlineTests/standard_wrong_key_root.json11
-rw-r--r--test/cmdlineTests/standard_wrong_key_root.json.exit1
-rw-r--r--test/cmdlineTests/standard_wrong_key_root.json.stdout1
-rw-r--r--test/cmdlineTests/standard_wrong_key_settings.json22
-rw-r--r--test/cmdlineTests/standard_wrong_key_settings.json.exit1
-rw-r--r--test/cmdlineTests/standard_wrong_key_settings.json.stdout1
-rw-r--r--test/cmdlineTests/standard_wrong_key_source.json11
-rw-r--r--test/cmdlineTests/standard_wrong_key_source.json.exit1
-rw-r--r--test/cmdlineTests/standard_wrong_key_source.json.stdout1
21 files changed, 126 insertions, 0 deletions
diff --git a/test/cmdlineTests/standard.json b/test/cmdlineTests/standard.json
new file mode 100644
index 00000000..826253b8
--- /dev/null
+++ b/test/cmdlineTests/standard.json
@@ -0,0 +1,10 @@
+{
+ "language": "Solidity",
+ "sources":
+ {
+ "A":
+ {
+ "content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
+ }
+ }
+}
diff --git a/test/cmdlineTests/standard.json.exit b/test/cmdlineTests/standard.json.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/cmdlineTests/standard.json.exit
@@ -0,0 +1 @@
+0
diff --git a/test/cmdlineTests/standard.json.stdout b/test/cmdlineTests/standard.json.stdout
new file mode 100644
index 00000000..ba4099e5
--- /dev/null
+++ b/test/cmdlineTests/standard.json.stdout
@@ -0,0 +1 @@
+{"contracts":{"A":{"C":{"evm":{}}}},"errors":[{"component":"general","formattedMessage":"Warning: This is a pre-release compiler version, please do not use it in production.\n","message":"This is a pre-release compiler version, please do not use it in production.","severity":"warning","type":"Warning"}],"sources":{"A":{"id":0}}}
diff --git a/test/cmdlineTests/standard_wrong_key_auxiliary_input.json b/test/cmdlineTests/standard_wrong_key_auxiliary_input.json
new file mode 100644
index 00000000..51dbce41
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_auxiliary_input.json
@@ -0,0 +1,14 @@
+{
+ "language": "Solidity",
+ "sources":
+ {
+ "A":
+ {
+ "content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
+ }
+ },
+ "auxiliaryInput":
+ {
+ "key1": "test"
+ }
+}
diff --git a/test/cmdlineTests/standard_wrong_key_auxiliary_input.json.exit b/test/cmdlineTests/standard_wrong_key_auxiliary_input.json.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_auxiliary_input.json.exit
@@ -0,0 +1 @@
+0
diff --git a/test/cmdlineTests/standard_wrong_key_auxiliary_input.json.stdout b/test/cmdlineTests/standard_wrong_key_auxiliary_input.json.stdout
new file mode 100644
index 00000000..077ac47e
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_auxiliary_input.json.stdout
@@ -0,0 +1 @@
+{"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
diff --git a/test/cmdlineTests/standard_wrong_key_metadata.json b/test/cmdlineTests/standard_wrong_key_metadata.json
new file mode 100644
index 00000000..490e489a
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_metadata.json
@@ -0,0 +1,22 @@
+{
+ "language": "Solidity",
+ "sources":
+ {
+ "A":
+ {
+ "content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
+ }
+ },
+ "settings":
+ {
+ "optimizer": {
+ "enabled": true,
+ "runs": 200
+ },
+ "evmVersion": "byzantium",
+ "metadata": {
+ "key1": "test",
+ "useLiteralContent": true
+ }
+ }
+}
diff --git a/test/cmdlineTests/standard_wrong_key_metadata.json.exit b/test/cmdlineTests/standard_wrong_key_metadata.json.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_metadata.json.exit
@@ -0,0 +1 @@
+0
diff --git a/test/cmdlineTests/standard_wrong_key_metadata.json.stdout b/test/cmdlineTests/standard_wrong_key_metadata.json.stdout
new file mode 100644
index 00000000..077ac47e
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_metadata.json.stdout
@@ -0,0 +1 @@
+{"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
diff --git a/test/cmdlineTests/standard_wrong_key_optimizer.json b/test/cmdlineTests/standard_wrong_key_optimizer.json
new file mode 100644
index 00000000..c28c3a92
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_optimizer.json
@@ -0,0 +1,22 @@
+{
+ "language": "Solidity",
+ "sources":
+ {
+ "A":
+ {
+ "content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
+ }
+ },
+ "settings":
+ {
+ "optimizer": {
+ "key1": "test",
+ "enabled": true,
+ "runs": 200
+ },
+ "evmVersion": "byzantium",
+ "metadata": {
+ "useLiteralContent": true
+ }
+ }
+}
diff --git a/test/cmdlineTests/standard_wrong_key_optimizer.json.exit b/test/cmdlineTests/standard_wrong_key_optimizer.json.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_optimizer.json.exit
@@ -0,0 +1 @@
+0
diff --git a/test/cmdlineTests/standard_wrong_key_optimizer.json.stdout b/test/cmdlineTests/standard_wrong_key_optimizer.json.stdout
new file mode 100644
index 00000000..077ac47e
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_optimizer.json.stdout
@@ -0,0 +1 @@
+{"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
diff --git a/test/cmdlineTests/standard_wrong_key_root.json b/test/cmdlineTests/standard_wrong_key_root.json
new file mode 100644
index 00000000..4689c50c
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_root.json
@@ -0,0 +1,11 @@
+{
+ "language": "Solidity",
+ "key1": "test",
+ "sources":
+ {
+ "A":
+ {
+ "content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
+ }
+ }
+}
diff --git a/test/cmdlineTests/standard_wrong_key_root.json.exit b/test/cmdlineTests/standard_wrong_key_root.json.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_root.json.exit
@@ -0,0 +1 @@
+0
diff --git a/test/cmdlineTests/standard_wrong_key_root.json.stdout b/test/cmdlineTests/standard_wrong_key_root.json.stdout
new file mode 100644
index 00000000..077ac47e
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_root.json.stdout
@@ -0,0 +1 @@
+{"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
diff --git a/test/cmdlineTests/standard_wrong_key_settings.json b/test/cmdlineTests/standard_wrong_key_settings.json
new file mode 100644
index 00000000..d7809b1c
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_settings.json
@@ -0,0 +1,22 @@
+{
+ "language": "Solidity",
+ "sources":
+ {
+ "A":
+ {
+ "content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
+ }
+ },
+ "settings":
+ {
+ "optimizer": {
+ "enabled": true,
+ "runs": 200
+ },
+ "evmVersion": "byzantium",
+ "metadata": {
+ "useLiteralContent": true
+ },
+ "key1": "test"
+ }
+}
diff --git a/test/cmdlineTests/standard_wrong_key_settings.json.exit b/test/cmdlineTests/standard_wrong_key_settings.json.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_settings.json.exit
@@ -0,0 +1 @@
+0
diff --git a/test/cmdlineTests/standard_wrong_key_settings.json.stdout b/test/cmdlineTests/standard_wrong_key_settings.json.stdout
new file mode 100644
index 00000000..077ac47e
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_settings.json.stdout
@@ -0,0 +1 @@
+{"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}
diff --git a/test/cmdlineTests/standard_wrong_key_source.json b/test/cmdlineTests/standard_wrong_key_source.json
new file mode 100644
index 00000000..d8a8aa16
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_source.json
@@ -0,0 +1,11 @@
+{
+ "language": "Solidity",
+ "sources":
+ {
+ "A":
+ {
+ "key1": "test",
+ "content": "pragma solidity >=0.0; contract C { function f() public pure {} }"
+ }
+ }
+}
diff --git a/test/cmdlineTests/standard_wrong_key_source.json.exit b/test/cmdlineTests/standard_wrong_key_source.json.exit
new file mode 100644
index 00000000..573541ac
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_source.json.exit
@@ -0,0 +1 @@
+0
diff --git a/test/cmdlineTests/standard_wrong_key_source.json.stdout b/test/cmdlineTests/standard_wrong_key_source.json.stdout
new file mode 100644
index 00000000..077ac47e
--- /dev/null
+++ b/test/cmdlineTests/standard_wrong_key_source.json.stdout
@@ -0,0 +1 @@
+{"errors":[{"component":"general","formattedMessage":"Unknown key \"key1\"","message":"Unknown key \"key1\"","severity":"error","type":"JSONError"}]}