diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-07-25 18:09:07 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2016-08-27 02:03:46 +0800 |
commit | 4019c832cad989ddb246d2189d19f38273d29661 (patch) | |
tree | fd24a2f336fb8d76f9d016f516da45217f5427d1 /test | |
parent | 36a567cd61bf88a5b23ceb9d7eee97f1a3069f80 (diff) | |
download | dexon-solidity-4019c832cad989ddb246d2189d19f38273d29661.tar dexon-solidity-4019c832cad989ddb246d2189d19f38273d29661.tar.gz dexon-solidity-4019c832cad989ddb246d2189d19f38273d29661.tar.bz2 dexon-solidity-4019c832cad989ddb246d2189d19f38273d29661.tar.lz dexon-solidity-4019c832cad989ddb246d2189d19f38273d29661.tar.xz dexon-solidity-4019c832cad989ddb246d2189d19f38273d29661.tar.zst dexon-solidity-4019c832cad989ddb246d2189d19f38273d29661.zip |
Add test for fallback function in JSON ABI
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityABIJSON.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp index b21e03eb..cfc7b9bd 100644 --- a/test/libsolidity/SolidityABIJSON.cpp +++ b/test/libsolidity/SolidityABIJSON.cpp @@ -273,15 +273,6 @@ BOOST_AUTO_TEST_CASE(const_function) checkInterface(sourceCode, interface); } -BOOST_AUTO_TEST_CASE(exclude_fallback_function) -{ - char const* sourceCode = "contract test { function() {} }"; - - char const* interface = "[]"; - - checkInterface(sourceCode, interface); -} - BOOST_AUTO_TEST_CASE(events) { char const* sourceCode = "contract test {\n" @@ -626,6 +617,25 @@ BOOST_AUTO_TEST_CASE(library_function) checkInterface(sourceCode, interface); } +BOOST_AUTO_TEST_CASE(include_fallback_function) +{ + char const* sourceCode = R"( + contract test { + function() {} + } + )"; + + char const* interface = R"( + [ + { + "constant" : false, + "type" : "fallback" + } + ] + )"; + checkInterface(sourceCode, interface); +} + BOOST_AUTO_TEST_SUITE_END() } |