diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-08-19 18:15:01 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-08-20 22:05:46 -0400 |
| commit | 5f3a637b7cbd026d0cb8f8ce2139fa6287d06b56 (patch) | |
| tree | 53777a590ab74ab23e7f58446246c8140872cf12 | |
| parent | 7727920ba279fbef9f55ffa2c334778c7ef25fc3 (diff) | |
| download | rust-5f3a637b7cbd026d0cb8f8ce2139fa6287d06b56.tar.gz rust-5f3a637b7cbd026d0cb8f8ce2139fa6287d06b56.zip | |
enable tests for the container tutorial
| -rwxr-xr-x | configure | 1 | ||||
| -rw-r--r-- | doc/tutorial-container.md | 6 | ||||
| -rw-r--r-- | mk/tests.mk | 2 | ||||
| -rw-r--r-- | src/libstd/prelude.rs | 6 |
4 files changed, 8 insertions, 7 deletions
diff --git a/configure b/configure index a3291725703..f070ae37dda 100755 --- a/configure +++ b/configure @@ -739,6 +739,7 @@ do make_dir $h/test/doc-tutorial-ffi make_dir $h/test/doc-tutorial-macros make_dir $h/test/doc-tutorial-borrowed-ptr + make_dir $h/test/doc-tutorial-container make_dir $h/test/doc-tutorial-tasks make_dir $h/test/doc-tutorial-conditions make_dir $h/test/doc-rust diff --git a/doc/tutorial-container.md b/doc/tutorial-container.md index bd706d41288..37ca561f74a 100644 --- a/doc/tutorial-container.md +++ b/doc/tutorial-container.md @@ -163,7 +163,7 @@ assert_eq!(sum, 57); The `for` keyword can be used as sugar for iterating through any iterator: ~~~ -let xs = [2, 3, 5, 7, 11, 13, 17]; +let xs = [2u, 3, 5, 7, 11, 13, 17]; // print out all the elements in the vector for x in xs.iter() { @@ -219,7 +219,7 @@ Containers can provide conversion from iterators through `collect` by implementing the `FromIterator` trait. For example, the implementation for vectors is as follows: -~~~ +~~~ {.xfail-test} impl<A> FromIterator<A> for ~[A] { pub fn from_iterator<T: Iterator<A>>(iterator: &mut T) -> ~[A] { let (lower, _) = iterator.size_hint(); @@ -237,7 +237,7 @@ impl<A> FromIterator<A> for ~[A] { The `Iterator` trait provides a `size_hint` default method, returning a lower bound and optionally on upper bound on the length of the iterator: -~~~ +~~~ {.xfail-test} fn size_hint(&self) -> (uint, Option<uint>) { (0, None) } ~~~ diff --git a/mk/tests.mk b/mk/tests.mk index 4732f808457..02fcf61412f 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -20,7 +20,7 @@ TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES) # Markdown files under doc/ that should have their code extracted and run DOC_TEST_NAMES = tutorial tutorial-ffi tutorial-macros tutorial-borrowed-ptr \ - tutorial-tasks tutorial-conditions rust + tutorial-tasks tutorial-conditions tutorial-container rust ###################################################################### # Environment configuration diff --git a/src/libstd/prelude.rs b/src/libstd/prelude.rs index 7a0346c94fc..e91c78e8223 100644 --- a/src/libstd/prelude.rs +++ b/src/libstd/prelude.rs @@ -50,9 +50,9 @@ pub use char::Char; pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet}; pub use hash::Hash; pub use iter::Times; -pub use iterator::Extendable; -pub use iterator::{Iterator, DoubleEndedIterator, ClonableIterator, OrdIterator}; -pub use iterator::MutableDoubleEndedIterator; +pub use iterator::{FromIterator, Extendable}; +pub use iterator::{Iterator, DoubleEndedIterator, RandomAccessIterator, ClonableIterator}; +pub use iterator::{OrdIterator, MutableDoubleEndedIterator}; pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul}; pub use num::{Orderable, Signed, Unsigned, Round}; pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic}; |
