aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/lib-int.rs
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-08-24 09:09:04 -0700
committerGraydon Hoare <[email protected]>2010-08-24 09:09:04 -0700
commit14262c73119349fd5452db0811a577febbc77670 (patch)
treed2cdef3e324346c84ed9fb6886ccdae405579084 /src/test/run-pass/lib-int.rs
parentAdd very basic char / str literal handling to rustc lexer. (diff)
downloadrust-14262c73119349fd5452db0811a577febbc77670.tar.xz
rust-14262c73119349fd5452db0811a577febbc77670.zip
Rename lib tests, enable lib-int.rs using _str.eq for now.
Diffstat (limited to 'src/test/run-pass/lib-int.rs')
-rw-r--r--src/test/run-pass/lib-int.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/run-pass/lib-int.rs b/src/test/run-pass/lib-int.rs
new file mode 100644
index 00000000..ecca40b9
--- /dev/null
+++ b/src/test/run-pass/lib-int.rs
@@ -0,0 +1,15 @@
+use std;
+
+import std._int;
+import std._str.eq;
+
+fn test_to_str() {
+ check (eq(_int.to_str(0, 10u), "0"));
+ check (eq(_int.to_str(1, 10u), "1"));
+ check (eq(_int.to_str(-1, 10u), "-1"));
+ check (eq(_int.to_str(255, 16u), "ff"));
+}
+
+fn main() {
+ test_to_str();
+}