aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityExpressionCompiler.cpp
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-06-28 21:19:53 +0800
committerChristian Parpart <christian@ethereum.org>2018-07-02 20:32:05 +0800
commite251cdcf47667ad3e7c88446d8b26cb3ae1bd0f2 (patch)
tree2537abaa6dc1cbcfc6c496935319f33563cddb43 /test/libsolidity/SolidityExpressionCompiler.cpp
parente289c36158701ba0b874051e9e426e270b0e38e2 (diff)
downloaddexon-solidity-e251cdcf47667ad3e7c88446d8b26cb3ae1bd0f2.tar.gz
dexon-solidity-e251cdcf47667ad3e7c88446d8b26cb3ae1bd0f2.tar.zst
dexon-solidity-e251cdcf47667ad3e7c88446d8b26cb3ae1bd0f2.zip
test: ensure compiled tests do not use var-keyword in preparation of var-keyword removal
Diffstat (limited to 'test/libsolidity/SolidityExpressionCompiler.cpp')
-rw-r--r--test/libsolidity/SolidityExpressionCompiler.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/libsolidity/SolidityExpressionCompiler.cpp b/test/libsolidity/SolidityExpressionCompiler.cpp
index 5d5fb218..2668dfdf 100644
--- a/test/libsolidity/SolidityExpressionCompiler.cpp
+++ b/test/libsolidity/SolidityExpressionCompiler.cpp
@@ -175,7 +175,7 @@ BOOST_AUTO_TEST_CASE(literal_true)
{
char const* sourceCode = R"(
contract test {
- function f() { var x = true; }
+ function f() { bool x = true; }
}
)";
bytes code = compileFirstExpression(sourceCode);
@@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(literal_false)
{
char const* sourceCode = R"(
contract test {
- function f() { var x = false; }
+ function f() { bool x = false; }
}
)";
bytes code = compileFirstExpression(sourceCode);
@@ -201,7 +201,7 @@ BOOST_AUTO_TEST_CASE(int_literal)
{
char const* sourceCode = R"(
contract test {
- function f() { var x = 0x12345678901234567890; }
+ function f() { uint x = 0x12345678901234567890; }
}
)";
bytes code = compileFirstExpression(sourceCode);
@@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(int_with_wei_ether_subdenomination)
char const* sourceCode = R"(
contract test {
constructor() {
- var x = 1 wei;
+ uint x = 1 wei;
}
}
)";
@@ -230,8 +230,8 @@ BOOST_AUTO_TEST_CASE(int_with_szabo_ether_subdenomination)
{
char const* sourceCode = R"(
contract test {
- constructor() {
- var x = 1 szabo;
+ function test () {
+ uint x = 1 szabo;
}
}
)";
@@ -247,7 +247,7 @@ BOOST_AUTO_TEST_CASE(int_with_finney_ether_subdenomination)
contract test {
constructor()
{
- var x = 1 finney;
+ uint x = 1 finney;
}
}
)";
@@ -262,7 +262,7 @@ BOOST_AUTO_TEST_CASE(int_with_ether_ether_subdenomination)
char const* sourceCode = R"(
contract test {
constructor() {
- var x = 1 ether;
+ uint x = 1 ether;
}
}
)";
@@ -276,7 +276,7 @@ BOOST_AUTO_TEST_CASE(comparison)
{
char const* sourceCode = R"(
contract test {
- function f() { var x = (0x10aa < 0x11aa) != true; }
+ function f() { bool x = (0x10aa < 0x11aa) != true; }
}
)";
bytes code = compileFirstExpression(sourceCode);
@@ -294,7 +294,7 @@ BOOST_AUTO_TEST_CASE(short_circuiting)
{
char const* sourceCode = R"(
contract test {
- function f() { var x = true != (4 <= 8 + 10 || 9 != 2); }
+ function f() { bool x = true != (4 <= 8 + 10 || 9 != 2); }
}
)";
bytes code = compileFirstExpression(sourceCode);
@@ -490,7 +490,7 @@ BOOST_AUTO_TEST_CASE(intermediately_overflowing_literals)
// have been applied
char const* sourceCode = R"(
contract test {
- function f() { var x = (0x00ffffffffffffffffffffffffffffffffffffffff * 0xffffffffffffffffffffffffff01) & 0xbf; }
+ function f() { uint8 x = (0x00ffffffffffffffffffffffffffffffffffffffff * 0xffffffffffffffffffffffffff01) & 0xbf; }
}
)";
bytes code = compileFirstExpression(sourceCode);