aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-04-20 08:52:50 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-04-21 00:38:16 +0800
commitedd20ebefb7c08c9e0a98e9ec0ff5b4edc0b9b0e (patch)
treea925522e82d84c561f05838e5fb1acaf6617ac99 /test
parent72b0412ef68f332c9dcdc66b554aabc3fb69ba59 (diff)
downloaddexon-solidity-edd20ebefb7c08c9e0a98e9ec0ff5b4edc0b9b0e.tar.gz
dexon-solidity-edd20ebefb7c08c9e0a98e9ec0ff5b4edc0b9b0e.tar.zst
dexon-solidity-edd20ebefb7c08c9e0a98e9ec0ff5b4edc0b9b0e.zip
Extract syntax tests
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp27
-rw-r--r--test/libsolidity/syntaxTests/deprecated_functions.sol12
2 files changed, 13 insertions, 26 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 97cf0410..3081b8f2 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -5823,7 +5823,7 @@ BOOST_AUTO_TEST_CASE(bare_others)
CHECK_WARNING("contract C { function f() pure public { assert; } }", "Statement has no effect.");
// This is different because it does have overloads.
CHECK_ERROR("contract C { function f() pure public { require; } }", TypeError, "No matching declaration found after variable lookup.");
- CHECK_WARNING("contract C { function f() pure public { suicide; } }", "Statement has no effect.");
+ CHECK_WARNING("contract C { function f() pure public { selfdestruct; } }", "Statement has no effect.");
}
BOOST_AUTO_TEST_CASE(pure_statement_in_for_loop)
@@ -6958,31 +6958,6 @@ BOOST_AUTO_TEST_CASE(invalid_literal_in_tuple)
CHECK_SUCCESS(text);
}
-BOOST_AUTO_TEST_CASE(warn_about_sha3)
-{
- char const* text = R"(
- contract test {
- function f() pure public {
- bytes32 x = sha3(uint8(1));
- x;
- }
- }
- )";
- CHECK_WARNING(text, "\"sha3\" has been deprecated in favour of \"keccak256\"");
-}
-
-BOOST_AUTO_TEST_CASE(warn_about_suicide)
-{
- char const* text = R"(
- contract test {
- function f() public {
- suicide(1);
- }
- }
- )";
- CHECK_WARNING(text, "\"suicide\" has been deprecated in favour of \"selfdestruct\"");
-}
-
BOOST_AUTO_TEST_CASE(address_overload_resolution)
{
char const* text = R"(
diff --git a/test/libsolidity/syntaxTests/deprecated_functions.sol b/test/libsolidity/syntaxTests/deprecated_functions.sol
new file mode 100644
index 00000000..57ee484a
--- /dev/null
+++ b/test/libsolidity/syntaxTests/deprecated_functions.sol
@@ -0,0 +1,12 @@
+contract test {
+ function f() pure public {
+ bytes32 x = sha3(uint8(1));
+ x;
+ }
+ function g() public {
+ suicide(1);
+ }
+}
+// ----
+// Warning: (58-72): "sha3" has been deprecated in favour of "keccak256"
+// Warning: (107-117): "suicide" has been deprecated in favour of "selfdestruct"