aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-04-12 05:20:40 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-04-12 05:20:40 +0800
commit932915633bb7f5985023f80a8c704cf8c5f979fa (patch)
tree50a9a0a3d691fcce18a214f005383dd48e8e4541 /test/libsolidity/syntaxTests
parentdaa69df447e167fe75d57a5bbbabee4d637218a4 (diff)
downloaddexon-solidity-932915633bb7f5985023f80a8c704cf8c5f979fa.tar
dexon-solidity-932915633bb7f5985023f80a8c704cf8c5f979fa.tar.gz
dexon-solidity-932915633bb7f5985023f80a8c704cf8c5f979fa.tar.bz2
dexon-solidity-932915633bb7f5985023f80a8c704cf8c5f979fa.tar.lz
dexon-solidity-932915633bb7f5985023f80a8c704cf8c5f979fa.tar.xz
dexon-solidity-932915633bb7f5985023f80a8c704cf8c5f979fa.tar.zst
dexon-solidity-932915633bb7f5985023f80a8c704cf8c5f979fa.zip
Add tests for literal operations as well.
Diffstat (limited to 'test/libsolidity/syntaxTests')
-rw-r--r--test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol5
-rw-r--r--test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol5
-rw-r--r--test/libsolidity/syntaxTests/literalOperations/mod_zero.sol5
-rw-r--r--test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol5
4 files changed, 20 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol b/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol
new file mode 100644
index 00000000..b52b4c51
--- /dev/null
+++ b/test/libsolidity/syntaxTests/literalOperations/division_by_zero.sol
@@ -0,0 +1,5 @@
+contract C {
+ uint constant a = 1 / 0;
+}
+// ----
+// TypeError: (35-40): Operator / not compatible with types int_const 1 and int_const 0
diff --git a/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol b/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol
new file mode 100644
index 00000000..8cc3b6f2
--- /dev/null
+++ b/test/libsolidity/syntaxTests/literalOperations/division_by_zero_complex.sol
@@ -0,0 +1,5 @@
+contract C {
+ uint constant a = 1 / ((1+3)-4);
+}
+// ----
+// TypeError: (35-48): Operator / not compatible with types int_const 1 and int_const 0
diff --git a/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol b/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol
new file mode 100644
index 00000000..1bbbc3fc
--- /dev/null
+++ b/test/libsolidity/syntaxTests/literalOperations/mod_zero.sol
@@ -0,0 +1,5 @@
+contract C {
+ uint constant b3 = 1 % 0;
+}
+// ----
+// TypeError: (36-41): Operator % not compatible with types int_const 1 and int_const 0
diff --git a/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol b/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol
new file mode 100644
index 00000000..4899cac3
--- /dev/null
+++ b/test/libsolidity/syntaxTests/literalOperations/mod_zero_complex.sol
@@ -0,0 +1,5 @@
+contract C {
+ uint constant b3 = 1 % (-4+((2)*2));
+}
+// ----
+// TypeError: (36-52): Operator % not compatible with types int_const 1 and int_const 0