aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-03-21 21:45:32 +0800
committerchriseth <chris@ethereum.org>2018-04-12 06:10:25 +0800
commit44c0d7ca5e1d97027e4f1e24fb02fd805eda578d (patch)
tree3d6836106b38a1d62c3515206c83780b9d56d638 /test/libsolidity/syntaxTests
parentd56acb68abdda19d0e5a684cdf8d40c3d7ce277e (diff)
downloaddexon-solidity-44c0d7ca5e1d97027e4f1e24fb02fd805eda578d.tar.gz
dexon-solidity-44c0d7ca5e1d97027e4f1e24fb02fd805eda578d.tar.zst
dexon-solidity-44c0d7ca5e1d97027e4f1e24fb02fd805eda578d.zip
Tests.
Diffstat (limited to 'test/libsolidity/syntaxTests')
-rw-r--r--test/libsolidity/syntaxTests/tight_packing_literals.sol25
-rw-r--r--test/libsolidity/syntaxTests/tight_packing_literals_fine.sol11
2 files changed, 36 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/tight_packing_literals.sol b/test/libsolidity/syntaxTests/tight_packing_literals.sol
new file mode 100644
index 00000000..8258a8a6
--- /dev/null
+++ b/test/libsolidity/syntaxTests/tight_packing_literals.sol
@@ -0,0 +1,25 @@
+contract C {
+ function f() pure public returns (bytes32) {
+ return keccak256(1);
+ }
+ function g() pure public returns (bytes32) {
+ return sha3(1);
+ }
+ function h() pure public returns (bytes32) {
+ return sha256(1);
+ }
+ function j() pure public returns (bytes32) {
+ return ripemd160(1);
+ }
+ function k() pure public returns (bytes) {
+ return abi.encodePacked(1);
+ }
+}
+
+// ----
+// Warning: (87-88): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
+// Warning: (161-168): "sha3" has been deprecated in favour of "keccak256"
+// Warning: (166-167): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
+// Warning: (247-248): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
+// Warning: (331-332): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
+// Warning: (420-421): The type of "int_const 1" was inferred as uint8. This is probably not desired. Use an explicit type to silence this warning.
diff --git a/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol b/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol
new file mode 100644
index 00000000..46407f71
--- /dev/null
+++ b/test/libsolidity/syntaxTests/tight_packing_literals_fine.sol
@@ -0,0 +1,11 @@
+contract C {
+ function f() pure public returns (bytes32) {
+ return keccak256(uint8(1));
+ }
+ function g() pure public returns (bytes) {
+ return abi.encode(1);
+ }
+ function h() pure public returns (bytes) {
+ return abi.encodePacked(uint8(1));
+ }
+}