aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-07-28 14:00:44 -0700
committerRoy Frostig <[email protected]>2010-07-28 14:00:44 -0700
commit596d19e2ea1f2cc96f7e493171a692bc0b912ce6 (patch)
treef9a4be20be28121856a359e31ba0d07c56bf1213 /src/test
parentSwitch machine-type lexemes to use suffixes. Remove support for foo(bar) as a... (diff)
downloadrust-596d19e2ea1f2cc96f7e493171a692bc0b912ce6.tar.xz
rust-596d19e2ea1f2cc96f7e493171a692bc0b912ce6.zip
Test the deque a bit. Give it a get-by-index method. Fix two uncovered state-calculation bugs --- one decently, the other with an ugly hack. Bug on the latter coming right up.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/lib-deque.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/run-pass/lib-deque.rs b/src/test/run-pass/lib-deque.rs
new file mode 100644
index 00000000..244092da
--- /dev/null
+++ b/src/test/run-pass/lib-deque.rs
@@ -0,0 +1,17 @@
+// -*- rust -*-
+
+use std;
+import std.deque;
+
+fn main() {
+ let deque.t[int] d1 = deque.create[int]();
+ check (d1.size() == 0u);
+ d1.add_front(17);
+ d1.add_front(42);
+ d1.add_back(137);
+ check (d1.size() == 3u);
+ d1.add_back(137);
+ check (d1.size() == 4u);
+ /* FIXME (issue #133): We should check that the numbers come back
+ * to us correctly once the deque stops zeroing them out. */
+}