summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorJoshua Wise <joshua@joshuawise.com>2011-11-09 01:44:42 -0800
committerBrian Anderson <banderson@mozilla.com>2011-11-09 14:33:06 -0800
commitae2ce0926704be87cdc64c5721a926ffef846154 (patch)
treed61f2b5593727cd372d8e031911ecc136ff84b21 /src/test
parentc8fae5dc75b8a5d1538e3c17ae34d087546da1f5 (diff)
downloadrust-ae2ce0926704be87cdc64c5721a926ffef846154.tar.gz
rust-ae2ce0926704be87cdc64c5721a926ffef846154.zip
Add test with implemented bits of issue #570.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/const-contents.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/const-contents.rs b/src/test/run-pass/const-contents.rs
new file mode 100644
index 00000000000..a8fd1378c9e
--- /dev/null
+++ b/src/test/run-pass/const-contents.rs
@@ -0,0 +1,17 @@
+// Issue #570
+
+const lsl : int = 1 << 2;
+const add : int = 1 + 2;
+const addf : float = 1.0f + 2.0f;
+const not : int = !0;
+const notb : bool = !true;
+const neg : int = -(1);
+
+fn main() {
+    assert(lsl == 4);
+    assert(add == 3);
+    assert(addf == 3.0f);
+    assert(not == -1);
+    assert(notb == false);
+    assert(neg == -1);
+}