aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-08-07 21:49:23 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-09-11 20:47:25 +0800
commitb6636e2570a14b33fbf53c3f59cca1a9dfb7f824 (patch)
tree04940ced6d9924f3a6a4638aa328a586d0e6a4da
parent395ab9a872bd8fafc0da7ec166176715ce18eae9 (diff)
downloaddexon-solidity-b6636e2570a14b33fbf53c3f59cca1a9dfb7f824.tar
dexon-solidity-b6636e2570a14b33fbf53c3f59cca1a9dfb7f824.tar.gz
dexon-solidity-b6636e2570a14b33fbf53c3f59cca1a9dfb7f824.tar.bz2
dexon-solidity-b6636e2570a14b33fbf53c3f59cca1a9dfb7f824.tar.lz
dexon-solidity-b6636e2570a14b33fbf53c3f59cca1a9dfb7f824.tar.xz
dexon-solidity-b6636e2570a14b33fbf53c3f59cca1a9dfb7f824.tar.zst
dexon-solidity-b6636e2570a14b33fbf53c3f59cca1a9dfb7f824.zip
Add new test cases.
-rw-r--r--test/libsolidity/ASTJSON/constructor.json70
-rw-r--r--test/libsolidity/ASTJSON/constructor.sol4
-rw-r--r--test/libsolidity/ASTJSON/constructor_legacy.json109
-rw-r--r--test/libsolidity/ASTJSON/fallback.json70
-rw-r--r--test/libsolidity/ASTJSON/fallback.sol4
-rw-r--r--test/libsolidity/ASTJSON/fallback_legacy.json109
-rw-r--r--test/libsolidity/ASTJSON/fallback_payable.json70
-rw-r--r--test/libsolidity/ASTJSON/fallback_payable.sol3
-rw-r--r--test/libsolidity/ASTJSON/fallback_payable_legacy.json109
9 files changed, 548 insertions, 0 deletions
diff --git a/test/libsolidity/ASTJSON/constructor.json b/test/libsolidity/ASTJSON/constructor.json
new file mode 100644
index 00000000..b0bc4201
--- /dev/null
+++ b/test/libsolidity/ASTJSON/constructor.json
@@ -0,0 +1,70 @@
+{
+ "absolutePath" : "a",
+ "exportedSymbols" :
+ {
+ "C" :
+ [
+ 5
+ ]
+ },
+ "id" : 6,
+ "nodeType" : "SourceUnit",
+ "nodes" :
+ [
+ {
+ "baseContracts" : [],
+ "contractDependencies" : [],
+ "contractKind" : "contract",
+ "documentation" : null,
+ "fullyImplemented" : true,
+ "id" : 5,
+ "linearizedBaseContracts" :
+ [
+ 5
+ ],
+ "name" : "C",
+ "nodeType" : "ContractDefinition",
+ "nodes" :
+ [
+ {
+ "body" :
+ {
+ "id" : 3,
+ "nodeType" : "Block",
+ "src" : "35:4:1",
+ "statements" : []
+ },
+ "documentation" : null,
+ "id" : 4,
+ "implemented" : true,
+ "kind" : "constructor",
+ "modifiers" : [],
+ "name" : "",
+ "nodeType" : "FunctionDefinition",
+ "parameters" :
+ {
+ "id" : 1,
+ "nodeType" : "ParameterList",
+ "parameters" : [],
+ "src" : "25:2:1"
+ },
+ "returnParameters" :
+ {
+ "id" : 2,
+ "nodeType" : "ParameterList",
+ "parameters" : [],
+ "src" : "35:0:1"
+ },
+ "scope" : 5,
+ "src" : "14:25:1",
+ "stateMutability" : "nonpayable",
+ "superFunction" : null,
+ "visibility" : "public"
+ }
+ ],
+ "scope" : 6,
+ "src" : "0:41:1"
+ }
+ ],
+ "src" : "0:42:1"
+}
diff --git a/test/libsolidity/ASTJSON/constructor.sol b/test/libsolidity/ASTJSON/constructor.sol
new file mode 100644
index 00000000..79d04eb5
--- /dev/null
+++ b/test/libsolidity/ASTJSON/constructor.sol
@@ -0,0 +1,4 @@
+contract C {
+ constructor() public {
+ }
+}
diff --git a/test/libsolidity/ASTJSON/constructor_legacy.json b/test/libsolidity/ASTJSON/constructor_legacy.json
new file mode 100644
index 00000000..73a58acf
--- /dev/null
+++ b/test/libsolidity/ASTJSON/constructor_legacy.json
@@ -0,0 +1,109 @@
+{
+ "attributes" :
+ {
+ "absolutePath" : "a",
+ "exportedSymbols" :
+ {
+ "C" :
+ [
+ 5
+ ]
+ }
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "baseContracts" :
+ [
+ null
+ ],
+ "contractDependencies" :
+ [
+ null
+ ],
+ "contractKind" : "contract",
+ "documentation" : null,
+ "fullyImplemented" : true,
+ "linearizedBaseContracts" :
+ [
+ 5
+ ],
+ "name" : "C",
+ "scope" : 6
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "documentation" : null,
+ "implemented" : true,
+ "kind" : "constructor",
+ "modifiers" :
+ [
+ null
+ ],
+ "name" : "",
+ "scope" : 5,
+ "stateMutability" : "nonpayable",
+ "superFunction" : null,
+ "visibility" : "public"
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "parameters" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 1,
+ "name" : "ParameterList",
+ "src" : "25:2:1"
+ },
+ {
+ "attributes" :
+ {
+ "parameters" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 2,
+ "name" : "ParameterList",
+ "src" : "35:0:1"
+ },
+ {
+ "attributes" :
+ {
+ "statements" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 3,
+ "name" : "Block",
+ "src" : "35:4:1"
+ }
+ ],
+ "id" : 4,
+ "name" : "FunctionDefinition",
+ "src" : "14:25:1"
+ }
+ ],
+ "id" : 5,
+ "name" : "ContractDefinition",
+ "src" : "0:41:1"
+ }
+ ],
+ "id" : 6,
+ "name" : "SourceUnit",
+ "src" : "0:42:1"
+}
diff --git a/test/libsolidity/ASTJSON/fallback.json b/test/libsolidity/ASTJSON/fallback.json
new file mode 100644
index 00000000..a9c85b2f
--- /dev/null
+++ b/test/libsolidity/ASTJSON/fallback.json
@@ -0,0 +1,70 @@
+{
+ "absolutePath" : "a",
+ "exportedSymbols" :
+ {
+ "C" :
+ [
+ 5
+ ]
+ },
+ "id" : 6,
+ "nodeType" : "SourceUnit",
+ "nodes" :
+ [
+ {
+ "baseContracts" : [],
+ "contractDependencies" : [],
+ "contractKind" : "contract",
+ "documentation" : null,
+ "fullyImplemented" : true,
+ "id" : 5,
+ "linearizedBaseContracts" :
+ [
+ 5
+ ],
+ "name" : "C",
+ "nodeType" : "ContractDefinition",
+ "nodes" :
+ [
+ {
+ "body" :
+ {
+ "id" : 3,
+ "nodeType" : "Block",
+ "src" : "43:5:1",
+ "statements" : []
+ },
+ "documentation" : null,
+ "id" : 4,
+ "implemented" : true,
+ "kind" : "fallback",
+ "modifiers" : [],
+ "name" : "",
+ "nodeType" : "FunctionDefinition",
+ "parameters" :
+ {
+ "id" : 1,
+ "nodeType" : "ParameterList",
+ "parameters" : [],
+ "src" : "23:2:1"
+ },
+ "returnParameters" :
+ {
+ "id" : 2,
+ "nodeType" : "ParameterList",
+ "parameters" : [],
+ "src" : "43:0:1"
+ },
+ "scope" : 5,
+ "src" : "15:33:1",
+ "stateMutability" : "payable",
+ "superFunction" : null,
+ "visibility" : "external"
+ }
+ ],
+ "scope" : 6,
+ "src" : "0:50:1"
+ }
+ ],
+ "src" : "0:51:1"
+}
diff --git a/test/libsolidity/ASTJSON/fallback.sol b/test/libsolidity/ASTJSON/fallback.sol
new file mode 100644
index 00000000..4e318892
--- /dev/null
+++ b/test/libsolidity/ASTJSON/fallback.sol
@@ -0,0 +1,4 @@
+contract C {
+ function() external payable {
+ }
+}
diff --git a/test/libsolidity/ASTJSON/fallback_legacy.json b/test/libsolidity/ASTJSON/fallback_legacy.json
new file mode 100644
index 00000000..2fbd0d98
--- /dev/null
+++ b/test/libsolidity/ASTJSON/fallback_legacy.json
@@ -0,0 +1,109 @@
+{
+ "attributes" :
+ {
+ "absolutePath" : "a",
+ "exportedSymbols" :
+ {
+ "C" :
+ [
+ 5
+ ]
+ }
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "baseContracts" :
+ [
+ null
+ ],
+ "contractDependencies" :
+ [
+ null
+ ],
+ "contractKind" : "contract",
+ "documentation" : null,
+ "fullyImplemented" : true,
+ "linearizedBaseContracts" :
+ [
+ 5
+ ],
+ "name" : "C",
+ "scope" : 6
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "documentation" : null,
+ "implemented" : true,
+ "kind" : "fallback",
+ "modifiers" :
+ [
+ null
+ ],
+ "name" : "",
+ "scope" : 5,
+ "stateMutability" : "payable",
+ "superFunction" : null,
+ "visibility" : "external"
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "parameters" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 1,
+ "name" : "ParameterList",
+ "src" : "23:2:1"
+ },
+ {
+ "attributes" :
+ {
+ "parameters" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 2,
+ "name" : "ParameterList",
+ "src" : "43:0:1"
+ },
+ {
+ "attributes" :
+ {
+ "statements" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 3,
+ "name" : "Block",
+ "src" : "43:5:1"
+ }
+ ],
+ "id" : 4,
+ "name" : "FunctionDefinition",
+ "src" : "15:33:1"
+ }
+ ],
+ "id" : 5,
+ "name" : "ContractDefinition",
+ "src" : "0:50:1"
+ }
+ ],
+ "id" : 6,
+ "name" : "SourceUnit",
+ "src" : "0:51:1"
+}
diff --git a/test/libsolidity/ASTJSON/fallback_payable.json b/test/libsolidity/ASTJSON/fallback_payable.json
new file mode 100644
index 00000000..9d56f74b
--- /dev/null
+++ b/test/libsolidity/ASTJSON/fallback_payable.json
@@ -0,0 +1,70 @@
+{
+ "absolutePath" : "a",
+ "exportedSymbols" :
+ {
+ "C" :
+ [
+ 5
+ ]
+ },
+ "id" : 6,
+ "nodeType" : "SourceUnit",
+ "nodes" :
+ [
+ {
+ "baseContracts" : [],
+ "contractDependencies" : [],
+ "contractKind" : "contract",
+ "documentation" : null,
+ "fullyImplemented" : true,
+ "id" : 5,
+ "linearizedBaseContracts" :
+ [
+ 5
+ ],
+ "name" : "C",
+ "nodeType" : "ContractDefinition",
+ "nodes" :
+ [
+ {
+ "body" :
+ {
+ "id" : 3,
+ "nodeType" : "Block",
+ "src" : "34:2:1",
+ "statements" : []
+ },
+ "documentation" : null,
+ "id" : 4,
+ "implemented" : true,
+ "kind" : "fallback",
+ "modifiers" : [],
+ "name" : "",
+ "nodeType" : "FunctionDefinition",
+ "parameters" :
+ {
+ "id" : 1,
+ "nodeType" : "ParameterList",
+ "parameters" : [],
+ "src" : "22:2:1"
+ },
+ "returnParameters" :
+ {
+ "id" : 2,
+ "nodeType" : "ParameterList",
+ "parameters" : [],
+ "src" : "34:0:1"
+ },
+ "scope" : 5,
+ "src" : "14:22:1",
+ "stateMutability" : "nonpayable",
+ "superFunction" : null,
+ "visibility" : "external"
+ }
+ ],
+ "scope" : 6,
+ "src" : "0:38:1"
+ }
+ ],
+ "src" : "0:39:1"
+}
diff --git a/test/libsolidity/ASTJSON/fallback_payable.sol b/test/libsolidity/ASTJSON/fallback_payable.sol
new file mode 100644
index 00000000..21db99ec
--- /dev/null
+++ b/test/libsolidity/ASTJSON/fallback_payable.sol
@@ -0,0 +1,3 @@
+contract C {
+ function() external {}
+}
diff --git a/test/libsolidity/ASTJSON/fallback_payable_legacy.json b/test/libsolidity/ASTJSON/fallback_payable_legacy.json
new file mode 100644
index 00000000..5f041961
--- /dev/null
+++ b/test/libsolidity/ASTJSON/fallback_payable_legacy.json
@@ -0,0 +1,109 @@
+{
+ "attributes" :
+ {
+ "absolutePath" : "a",
+ "exportedSymbols" :
+ {
+ "C" :
+ [
+ 5
+ ]
+ }
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "baseContracts" :
+ [
+ null
+ ],
+ "contractDependencies" :
+ [
+ null
+ ],
+ "contractKind" : "contract",
+ "documentation" : null,
+ "fullyImplemented" : true,
+ "linearizedBaseContracts" :
+ [
+ 5
+ ],
+ "name" : "C",
+ "scope" : 6
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "documentation" : null,
+ "implemented" : true,
+ "kind" : "fallback",
+ "modifiers" :
+ [
+ null
+ ],
+ "name" : "",
+ "scope" : 5,
+ "stateMutability" : "nonpayable",
+ "superFunction" : null,
+ "visibility" : "external"
+ },
+ "children" :
+ [
+ {
+ "attributes" :
+ {
+ "parameters" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 1,
+ "name" : "ParameterList",
+ "src" : "22:2:1"
+ },
+ {
+ "attributes" :
+ {
+ "parameters" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 2,
+ "name" : "ParameterList",
+ "src" : "34:0:1"
+ },
+ {
+ "attributes" :
+ {
+ "statements" :
+ [
+ null
+ ]
+ },
+ "children" : [],
+ "id" : 3,
+ "name" : "Block",
+ "src" : "34:2:1"
+ }
+ ],
+ "id" : 4,
+ "name" : "FunctionDefinition",
+ "src" : "14:22:1"
+ }
+ ],
+ "id" : 5,
+ "name" : "ContractDefinition",
+ "src" : "0:38:1"
+ }
+ ],
+ "id" : 6,
+ "name" : "SourceUnit",
+ "src" : "0:39:1"
+}