aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-04-19 02:40:08 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-04-19 05:52:29 +0800
commit17beac1e07fba46f14d458ee600502c1da723f4f (patch)
tree680bc2ae64308825c0c96e0c37116c4a7e8009a6
parent39b7b44a8d63c9e50911ba724221b4a6399e7f5e (diff)
downloaddexon-solidity-17beac1e07fba46f14d458ee600502c1da723f4f.tar.gz
dexon-solidity-17beac1e07fba46f14d458ee600502c1da723f4f.tar.zst
dexon-solidity-17beac1e07fba46f14d458ee600502c1da723f4f.zip
Extract tests.
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp15
-rw-r--r--test/libsolidity/syntaxTests/memberLookup/memory_structs_with_mappings.sol10
2 files changed, 10 insertions, 15 deletions
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/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.