diff options
Diffstat (limited to 'test')
6 files changed, 34 insertions, 22 deletions
diff --git a/test/externalTests.sh b/test/externalTests.sh index 2a5ff7ef..cd6deb75 100755 --- a/test/externalTests.sh +++ b/test/externalTests.sh @@ -47,13 +47,6 @@ function test_truffle cd "$DIR" npm install find . -name soljson.js -exec cp "$SOLJSON" {} \; - if [ "$name" == "Zeppelin" ]; then - # Fix some things that look like bugs (only seemed to fail on Node 6 and not Node 8) - # FIXME: report upstream or to web3.js? - sed -i -e 's/let token = await ERC827TokenMock.new();//;' test/token/ERC827/ERC827Token.js - sed -i -e 's/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0)/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address)/' test/crowdsale/CappedCrowdsale.test.js - sed -i -e 's/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, { from: owner })/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address, { from: owner })/' test/crowdsale/RefundableCrowdsale.test.js - fi if [ "$name" == "Gnosis" ]; then # Replace fixed-version pragmas in Gnosis (part of Consensys best practice) find contracts test -name '*.sol' -type f -print0 | xargs -0 sed -i -e 's/pragma solidity 0/pragma solidity ^0/' diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 7c0e8643..97cf0410 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -2993,21 +2993,6 @@ BOOST_AUTO_TEST_CASE(literal_strings) CHECK_SUCCESS(text); } -BOOST_AUTO_TEST_CASE(memory_structs_with_mappings) -{ - char const* text = R"( - contract Test { - struct S { uint8 a; mapping(uint => uint) b; uint8 c; } - S s; - function f() public { - S memory x; - x.b[1]; - } - } - )"; - CHECK_ERROR(text, TypeError, "Member \"b\" is not available in struct Test.S memory outside of storage."); -} - BOOST_AUTO_TEST_CASE(string_bytes_conversion) { char const* text = R"( diff --git a/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup.sol b/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup.sol new file mode 100644 index 00000000..c23992e9 --- /dev/null +++ b/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup.sol @@ -0,0 +1,7 @@ +contract C { + function f(uint, uint) {} + function f(uint) {} + function g() { f(1, 2, 3); } +} +// ---- +// TypeError: (80-81): No matching declaration found after argument-dependent lookup. diff --git a/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup_in_library.sol b/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup_in_library.sol new file mode 100644 index 00000000..310c4a10 --- /dev/null +++ b/test/libsolidity/syntaxTests/memberLookup/failed_function_lookup_in_library.sol @@ -0,0 +1,9 @@ +library L { + function f(uint, uint) {} + function f(uint) {} +} +contract C { + function g() { L.f(1, 2, 3); } +} +// ---- +// TypeError: (94-97): Member "f" not found or not visible after argument-dependent lookup in type(library L) diff --git a/test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol b/test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol new file mode 100644 index 00000000..bdafc754 --- /dev/null +++ b/test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol @@ -0,0 +1,10 @@ +contract Test { + struct S { uint8 a; mapping(uint => uint) b; uint8 c; } + S s; + function f() public { + S memory x; + x.b[1]; + } +} +// ---- +// TypeError: (118-121): Member "b" is not available in struct Test.S memory outside of storage. diff --git a/test/libsolidity/syntaxTests/memberLookup/push_on_memory_types.sol b/test/libsolidity/syntaxTests/memberLookup/push_on_memory_types.sol new file mode 100644 index 00000000..310c073f --- /dev/null +++ b/test/libsolidity/syntaxTests/memberLookup/push_on_memory_types.sol @@ -0,0 +1,8 @@ +contract Test { + function f() public pure { + uint[] memory x; + x.push(1); + } +} +// ---- +// TypeError: (77-83): Member "push" is not available in uint256[] memory outside of storage. |