mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 20:28:33 +00:00
Fix fallout of removing import_shadowing in tests.
This commit is contained in:
parent
f95e0c21aa
commit
b45d30da34
@ -8,7 +8,7 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
use std::rand;
|
use std::rand;
|
||||||
use std::rand::Rng;
|
use std::rand::Rng;
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
|
@ -617,10 +617,9 @@ impl<T: Ord> Extend<T> for BinaryHeap<T> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
|
|
||||||
use super::BinaryHeap;
|
use super::BinaryHeap;
|
||||||
use vec::Vec;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_iterator() {
|
fn test_iterator() {
|
||||||
|
@ -1686,16 +1686,15 @@ impl<'a> Iterator<uint> for TwoBitPositions<'a> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
use std::iter::range_step;
|
use core::iter::range_step;
|
||||||
|
use core::u32;
|
||||||
use std::rand;
|
use std::rand;
|
||||||
use std::rand::Rng;
|
use std::rand::Rng;
|
||||||
use std::u32;
|
|
||||||
use test::{Bencher, black_box};
|
use test::{Bencher, black_box};
|
||||||
|
|
||||||
use super::{Bitv, BitvSet, from_fn, from_bytes};
|
use super::{Bitv, BitvSet, from_fn, from_bytes};
|
||||||
use bitv;
|
use bitv;
|
||||||
use vec::Vec;
|
|
||||||
|
|
||||||
static BENCH_BITS : uint = 1 << 14;
|
static BENCH_BITS : uint = 1 << 14;
|
||||||
|
|
||||||
@ -2038,7 +2037,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_from_bytes() {
|
fn test_from_bytes() {
|
||||||
let bitv = from_bytes(&[0b10110110, 0b00000000, 0b11111111]);
|
let bitv = from_bytes(&[0b10110110, 0b00000000, 0b11111111]);
|
||||||
let str = format!("{}{}{}", "10110110", "00000000", "11111111");
|
let str = concat!("10110110", "00000000", "11111111");
|
||||||
assert_eq!(bitv.to_string(), str);
|
assert_eq!(bitv.to_string(), str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1335,7 +1335,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
|
|
||||||
use super::{BTreeMap, Occupied, Vacant};
|
use super::{BTreeMap, Occupied, Vacant};
|
||||||
|
|
||||||
@ -1537,7 +1537,7 @@ mod test {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod bench {
|
mod bench {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
use std::rand::{weak_rng, Rng};
|
use std::rand::{weak_rng, Rng};
|
||||||
use test::{Bencher, black_box};
|
use test::{Bencher, black_box};
|
||||||
|
|
||||||
|
@ -726,7 +726,7 @@ impl<'a, T: Ord> Iterator<&'a T> for UnionItems<'a, T> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
|
|
||||||
use super::BTreeSet;
|
use super::BTreeSet;
|
||||||
use std::hash;
|
use std::hash;
|
||||||
|
@ -788,14 +788,14 @@ impl<S: Writer, A: Hash<S>> Hash<S> for DList<A> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
use std::rand;
|
use std::rand;
|
||||||
use std::hash;
|
use std::hash;
|
||||||
|
use std::task::spawn;
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
use super::{DList, Node, ListInsertion};
|
use super::{DList, Node, ListInsertion};
|
||||||
use vec::Vec;
|
|
||||||
|
|
||||||
pub fn check_links<T>(list: &DList<T>) {
|
pub fn check_links<T>(list: &DList<T>) {
|
||||||
let mut len = 0u;
|
let mut len = 0u;
|
||||||
|
@ -295,9 +295,9 @@ impl<E:CLike> Extend<E> for EnumSet<E> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use std::prelude::*;
|
|
||||||
use self::Foo::*;
|
use self::Foo::*;
|
||||||
use std::mem;
|
use prelude::*;
|
||||||
|
use core::mem;
|
||||||
|
|
||||||
use super::{EnumSet, CLike};
|
use super::{EnumSet, CLike};
|
||||||
|
|
||||||
|
@ -95,3 +95,41 @@ mod std {
|
|||||||
pub use core::kinds; // deriving(Copy)
|
pub use core::kinds; // deriving(Copy)
|
||||||
pub use core::hash; // deriving(Hash)
|
pub use core::hash; // deriving(Hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod prelude {
|
||||||
|
// from core.
|
||||||
|
pub use core::borrow::IntoCow;
|
||||||
|
pub use core::char::Char;
|
||||||
|
pub use core::clone::Clone;
|
||||||
|
pub use core::cmp::{PartialEq, Eq, Equiv, PartialOrd, Ord};
|
||||||
|
pub use core::cmp::Ordering::{Less, Equal, Greater};
|
||||||
|
pub use core::iter::range;
|
||||||
|
pub use core::iter::{FromIterator, Extend, IteratorExt};
|
||||||
|
pub use core::iter::{Iterator, DoubleEndedIterator, RandomAccessIterator};
|
||||||
|
pub use core::iter::{IteratorCloneExt, CloneIteratorExt, DoubleEndedIteratorExt};
|
||||||
|
pub use core::iter::{IteratorOrdExt, MutableDoubleEndedIterator, ExactSizeIterator};
|
||||||
|
pub use core::kinds::{Copy, Send, Sized, Sync};
|
||||||
|
pub use core::mem::drop;
|
||||||
|
pub use core::ops::{Drop, Fn, FnMut, FnOnce};
|
||||||
|
pub use core::option::Option;
|
||||||
|
pub use core::option::Option::{Some, None};
|
||||||
|
pub use core::ptr::RawPtr;
|
||||||
|
pub use core::result::Result;
|
||||||
|
pub use core::result::Result::{Ok, Err};
|
||||||
|
|
||||||
|
// in core and collections (may differ).
|
||||||
|
pub use slice::{PartialEqSliceExt, OrdSliceExt};
|
||||||
|
pub use slice::{AsSlice, SliceExt};
|
||||||
|
pub use str::{from_str, Str, StrPrelude};
|
||||||
|
|
||||||
|
// from other crates.
|
||||||
|
pub use alloc::boxed::Box;
|
||||||
|
pub use unicode::char::UnicodeChar;
|
||||||
|
|
||||||
|
// from collections.
|
||||||
|
pub use slice::{CloneSliceExt, VectorVector};
|
||||||
|
pub use str::{IntoMaybeOwned, UnicodeStrPrelude, StrAllocating, StrVector};
|
||||||
|
pub use string::{String, ToString};
|
||||||
|
pub use vec::Vec;
|
||||||
|
}
|
||||||
|
@ -1260,18 +1260,17 @@ impl<T: fmt::Show> fmt::Show for RingBuf<T> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use core::iter;
|
|
||||||
use self::Taggy::*;
|
use self::Taggy::*;
|
||||||
use self::Taggypar::*;
|
use self::Taggypar::*;
|
||||||
use std::cmp;
|
use prelude::*;
|
||||||
|
use core::cmp;
|
||||||
|
use core::iter;
|
||||||
use std::fmt::Show;
|
use std::fmt::Show;
|
||||||
use std::prelude::*;
|
|
||||||
use std::hash;
|
use std::hash;
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
use super::RingBuf;
|
use super::RingBuf;
|
||||||
use vec::Vec;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[allow(deprecated)]
|
#[allow(deprecated)]
|
||||||
@ -1791,7 +1790,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_from_iter() {
|
fn test_from_iter() {
|
||||||
use std::iter;
|
use core::iter;
|
||||||
let v = vec!(1i,2,3,4,5,6,7);
|
let v = vec!(1i,2,3,4,5,6,7);
|
||||||
let deq: RingBuf<int> = v.iter().map(|&x| x).collect();
|
let deq: RingBuf<int> = v.iter().map(|&x| x).collect();
|
||||||
let u: Vec<int> = deq.iter().map(|&x| x).collect();
|
let u: Vec<int> = deq.iter().map(|&x| x).collect();
|
||||||
|
@ -1343,16 +1343,13 @@ pub mod raw {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::boxed::Box;
|
use std::boxed::Box;
|
||||||
use std::cell::Cell;
|
use prelude::*;
|
||||||
use std::default::Default;
|
use core::cell::Cell;
|
||||||
use std::mem;
|
use core::default::Default;
|
||||||
use std::prelude::*;
|
use core::mem;
|
||||||
use std::rand::{Rng, task_rng};
|
use std::rand::{Rng, task_rng};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::rt;
|
use super::ElementSwaps;
|
||||||
use slice::*;
|
|
||||||
|
|
||||||
use vec::Vec;
|
|
||||||
|
|
||||||
fn square(n: uint) -> uint { n * n }
|
fn square(n: uint) -> uint { n * n }
|
||||||
|
|
||||||
@ -2764,14 +2761,12 @@ mod tests {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod bench {
|
mod bench {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
|
use core::mem;
|
||||||
|
use core::ptr;
|
||||||
use std::rand::{weak_rng, Rng};
|
use std::rand::{weak_rng, Rng};
|
||||||
use std::mem;
|
|
||||||
use std::ptr;
|
|
||||||
use test::{Bencher, black_box};
|
use test::{Bencher, black_box};
|
||||||
|
|
||||||
use vec::Vec;
|
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn iterator(b: &mut Bencher) {
|
fn iterator(b: &mut Bencher) {
|
||||||
// peculiar numbers to stop LLVM from optimising the summation
|
// peculiar numbers to stop LLVM from optimising the summation
|
||||||
|
@ -837,25 +837,12 @@ impl<'a> StrAllocating for &'a str {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::iter::AdditiveIterator;
|
use prelude::*;
|
||||||
use std::iter::range;
|
use core::default::Default;
|
||||||
use std::default::Default;
|
use core::iter::AdditiveIterator;
|
||||||
use std::char::Char;
|
use super::{eq_slice, from_utf8, is_utf8, is_utf16, raw};
|
||||||
use std::clone::Clone;
|
use super::truncate_utf16_at_nul;
|
||||||
use std::cmp::{Ord, PartialOrd, Equiv};
|
use super::{Owned, Slice};
|
||||||
use std::cmp::Ordering::{Equal, Greater, Less};
|
|
||||||
use std::option::Option;
|
|
||||||
use std::option::Option::{Some, None};
|
|
||||||
use std::ptr::RawPtr;
|
|
||||||
use std::iter::{Iterator, IteratorExt, DoubleEndedIteratorExt};
|
|
||||||
|
|
||||||
use super::*;
|
|
||||||
use std::slice::{AsSlice, SliceExt};
|
|
||||||
use string::String;
|
|
||||||
use vec::Vec;
|
|
||||||
use slice::CloneSliceExt;
|
|
||||||
|
|
||||||
use unicode::char::UnicodeChar;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_eq_slice() {
|
fn test_eq_slice() {
|
||||||
@ -1829,7 +1816,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_lev_distance() {
|
fn test_lev_distance() {
|
||||||
use std::char::{ from_u32, MAX };
|
use core::char::{ from_u32, MAX };
|
||||||
// Test bytelength agnosticity
|
// Test bytelength agnosticity
|
||||||
for c in range(0u32, MAX as u32)
|
for c in range(0u32, MAX as u32)
|
||||||
.filter_map(|i| from_u32(i))
|
.filter_map(|i| from_u32(i))
|
||||||
@ -1939,7 +1926,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_graphemes() {
|
fn test_graphemes() {
|
||||||
use std::iter::order;
|
use core::iter::order;
|
||||||
// official Unicode test data
|
// official Unicode test data
|
||||||
// from http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt
|
// from http://www.unicode.org/Public/UCD/latest/ucd/auxiliary/GraphemeBreakTest.txt
|
||||||
let test_same: [(_, &[_]), .. 325] = [
|
let test_same: [(_, &[_]), .. 325] = [
|
||||||
@ -2370,7 +2357,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_str_default() {
|
fn test_str_default() {
|
||||||
use std::default::Default;
|
use core::default::Default;
|
||||||
fn t<S: Default + Str>() {
|
fn t<S: Default + Str>() {
|
||||||
let s: S = Default::default();
|
let s: S = Default::default();
|
||||||
assert_eq!(s.as_slice(), "");
|
assert_eq!(s.as_slice(), "");
|
||||||
@ -2470,12 +2457,10 @@ mod tests {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod bench {
|
mod bench {
|
||||||
|
use prelude::*;
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
use test::black_box;
|
use test::black_box;
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::iter::{IteratorExt, DoubleEndedIteratorExt};
|
|
||||||
use std::str::StrPrelude;
|
|
||||||
use std::slice::SliceExt;
|
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn char_iterator(b: &mut Bencher) {
|
fn char_iterator(b: &mut Bencher) {
|
||||||
|
@ -1040,14 +1040,11 @@ pub mod raw {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
|
|
||||||
use slice::CloneSliceExt;
|
|
||||||
use str::{Str, StrPrelude};
|
|
||||||
use str;
|
use str;
|
||||||
use super::{as_string, String, ToString};
|
use super::as_string;
|
||||||
use vec::Vec;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_as_string() {
|
fn test_as_string() {
|
||||||
|
@ -1805,12 +1805,10 @@ impl<'a> fmt::FormatWriter for Vec<u8> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
extern crate test;
|
use prelude::*;
|
||||||
|
use core::mem::size_of;
|
||||||
use std::prelude::*;
|
|
||||||
use std::mem::size_of;
|
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
use super::{as_vec, unzip, raw, Vec};
|
use super::{as_vec, unzip, raw};
|
||||||
|
|
||||||
struct DropCounter<'a> {
|
struct DropCounter<'a> {
|
||||||
count: &'a mut int
|
count: &'a mut int
|
||||||
|
@ -672,8 +672,7 @@ impl<V> DoubleEndedIterator<(uint, V)> for MoveItems<V> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test_map {
|
mod test_map {
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
use vec::Vec;
|
|
||||||
use core::hash::hash;
|
use core::hash::hash;
|
||||||
|
|
||||||
use super::VecMap;
|
use super::VecMap;
|
||||||
@ -1046,8 +1045,7 @@ mod test_map {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod bench {
|
mod bench {
|
||||||
extern crate test;
|
use test::Bencher;
|
||||||
use self::test::Bencher;
|
|
||||||
use super::VecMap;
|
use super::VecMap;
|
||||||
use bench::{insert_rand_n, insert_seq_n, find_rand_n, find_seq_n};
|
use bench::{insert_rand_n, insert_seq_n, find_rand_n, find_seq_n};
|
||||||
|
|
||||||
|
@ -271,14 +271,9 @@ pub fn hash_with_keys<Sized? T: Hash<SipState>>(k0: u64, k1: u64, value: &T) ->
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
use std::prelude::*;
|
use prelude::*;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
use str::Str;
|
|
||||||
use string::String;
|
|
||||||
use slice::{AsSlice, SliceExt};
|
|
||||||
use vec::Vec;
|
|
||||||
|
|
||||||
use super::super::{Hash, Writer};
|
use super::super::{Hash, Writer};
|
||||||
use super::{SipState, hash, hash_with_keys};
|
use super::{SipState, hash, hash_with_keys};
|
||||||
|
|
||||||
|
@ -633,7 +633,6 @@ mod tests {
|
|||||||
use prelude::*;
|
use prelude::*;
|
||||||
use super::*;
|
use super::*;
|
||||||
use char::from_u32;
|
use char::from_u32;
|
||||||
use str::StrPrelude;
|
|
||||||
|
|
||||||
macro_rules! v2ascii {
|
macro_rules! v2ascii {
|
||||||
( [$($e:expr),*]) => (&[$(Ascii{chr:$e}),*]);
|
( [$($e:expr),*]) => (&[$(Ascii{chr:$e}),*]);
|
||||||
|
@ -315,7 +315,6 @@ macro_rules! bitflags {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[allow(non_upper_case_globals)]
|
#[allow(non_upper_case_globals)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use kinds::Copy;
|
|
||||||
use hash;
|
use hash;
|
||||||
use option::Option::{Some, None};
|
use option::Option::{Some, None};
|
||||||
use ops::{BitOr, BitAnd, BitXor, Sub, Not};
|
use ops::{BitOr, BitAnd, BitXor, Sub, Not};
|
||||||
|
@ -1428,9 +1428,8 @@ mod test_map {
|
|||||||
|
|
||||||
use super::HashMap;
|
use super::HashMap;
|
||||||
use super::{Occupied, Vacant};
|
use super::{Occupied, Vacant};
|
||||||
use cmp::Equiv;
|
|
||||||
use hash;
|
use hash;
|
||||||
use iter::{Iterator,range_inclusive,range_step_inclusive};
|
use iter::{range_inclusive, range_step_inclusive};
|
||||||
use cell::RefCell;
|
use cell::RefCell;
|
||||||
use rand::{weak_rng, Rng};
|
use rand::{weak_rng, Rng};
|
||||||
|
|
||||||
|
@ -678,7 +678,6 @@ mod test_set {
|
|||||||
use prelude::*;
|
use prelude::*;
|
||||||
|
|
||||||
use super::HashSet;
|
use super::HashSet;
|
||||||
use slice::PartialEqSliceExt;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_disjoint() {
|
fn test_disjoint() {
|
||||||
|
@ -409,7 +409,6 @@ mod test {
|
|||||||
use super::super::{IoResult, EndOfFile};
|
use super::super::{IoResult, EndOfFile};
|
||||||
use super::super::mem::MemReader;
|
use super::super::mem::MemReader;
|
||||||
use self::test::Bencher;
|
use self::test::Bencher;
|
||||||
use str::StrPrelude;
|
|
||||||
|
|
||||||
/// A type, free to create, primarily intended for benchmarking creation of
|
/// A type, free to create, primarily intended for benchmarking creation of
|
||||||
/// wrappers that, just for construction, don't need a Reader/Writer that
|
/// wrappers that, just for construction, don't need a Reader/Writer that
|
||||||
|
@ -823,10 +823,6 @@ mod test {
|
|||||||
use io;
|
use io;
|
||||||
use str;
|
use str;
|
||||||
use io::fs::*;
|
use io::fs::*;
|
||||||
use path::Path;
|
|
||||||
use io;
|
|
||||||
use ops::Drop;
|
|
||||||
use str::StrPrelude;
|
|
||||||
|
|
||||||
macro_rules! check { ($e:expr) => (
|
macro_rules! check { ($e:expr) => (
|
||||||
match $e {
|
match $e {
|
||||||
|
@ -398,13 +398,12 @@ impl<'a> Buffer for BufReader<'a> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
extern crate test;
|
extern crate "test" as test_crate;
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
use super::*;
|
use super::*;
|
||||||
use io::*;
|
use io::*;
|
||||||
use io;
|
use io;
|
||||||
use self::test::Bencher;
|
use self::test_crate::Bencher;
|
||||||
use str::StrPrelude;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_vec_writer() {
|
fn test_vec_writer() {
|
||||||
|
@ -225,11 +225,11 @@ fn in_ms_u64(d: Duration) -> u64 {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use super::*;
|
|
||||||
use time::Duration;
|
|
||||||
use task::spawn;
|
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
|
|
||||||
|
use super::Timer;
|
||||||
|
use time::Duration;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_io_timer_sleep_simple() {
|
fn test_io_timer_sleep_simple() {
|
||||||
let mut timer = Timer::new().unwrap();
|
let mut timer = Timer::new().unwrap();
|
||||||
|
@ -157,7 +157,7 @@ pub use core::unit;
|
|||||||
pub use core::result;
|
pub use core::result;
|
||||||
pub use core::option;
|
pub use core::option;
|
||||||
|
|
||||||
pub use alloc::boxed;
|
#[cfg(not(test))] pub use alloc::boxed;
|
||||||
pub use alloc::rc;
|
pub use alloc::rc;
|
||||||
|
|
||||||
pub use core_collections::slice;
|
pub use core_collections::slice;
|
||||||
|
@ -349,7 +349,6 @@ pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> String {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use f32::*;
|
use f32::*;
|
||||||
use num::*;
|
use num::*;
|
||||||
use num;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_min_nan() {
|
fn test_min_nan() {
|
||||||
@ -364,8 +363,8 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_num() {
|
fn test_num_f32() {
|
||||||
num::test_num(10f32, 2f32);
|
test_num(10f32, 2f32);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -357,7 +357,6 @@ pub fn to_str_exp_digits(num: f64, dig: uint, upper: bool) -> String {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use f64::*;
|
use f64::*;
|
||||||
use num::*;
|
use num::*;
|
||||||
use num;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_min_nan() {
|
fn test_min_nan() {
|
||||||
@ -372,8 +371,8 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_num() {
|
fn test_num_f64() {
|
||||||
num::test_num(10f64, 2f64);
|
test_num(10f64, 2f64);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1425,7 +1425,6 @@ mod arch_consts {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
use c_str::ToCStr;
|
|
||||||
use option;
|
use option;
|
||||||
use os::{env, getcwd, getenv, make_absolute};
|
use os::{env, getcwd, getenv, make_absolute};
|
||||||
use os::{split_paths, join_paths, setenv, unsetenv};
|
use os::{split_paths, join_paths, setenv, unsetenv};
|
||||||
|
@ -931,8 +931,6 @@ fn contains_nul<T: BytesContainer>(v: &T) -> bool {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
use super::{GenericPath, PosixPath, WindowsPath};
|
|
||||||
use c_str::ToCStr;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_cstring() {
|
fn test_cstring() {
|
||||||
|
@ -445,7 +445,6 @@ mod tests {
|
|||||||
use prelude::*;
|
use prelude::*;
|
||||||
use super::*;
|
use super::*;
|
||||||
use str;
|
use str;
|
||||||
use str::StrPrelude;
|
|
||||||
|
|
||||||
macro_rules! t {
|
macro_rules! t {
|
||||||
(s: $path:expr, $exp:expr) => (
|
(s: $path:expr, $exp:expr) => (
|
||||||
|
@ -153,7 +153,6 @@ mod test {
|
|||||||
use prelude::*;
|
use prelude::*;
|
||||||
use sync::Future;
|
use sync::Future;
|
||||||
use task;
|
use task;
|
||||||
use comm::channel;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_from_value() {
|
fn test_from_value() {
|
||||||
|
@ -131,10 +131,8 @@ fn spawn_in_pool(jobs: Arc<Mutex<Receiver<Thunk>>>) {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
use core::prelude::*;
|
use prelude::*;
|
||||||
use super::*;
|
use super::*;
|
||||||
use comm::channel;
|
|
||||||
use iter::range;
|
|
||||||
|
|
||||||
const TEST_TASKS: uint = 4u;
|
const TEST_TASKS: uint = 4u;
|
||||||
|
|
||||||
|
@ -428,13 +428,11 @@ impl<T: Send> Drop for JoinGuard<T> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
|
use prelude::*;
|
||||||
use any::{Any, AnyRefExt};
|
use any::{Any, AnyRefExt};
|
||||||
use boxed::BoxAny;
|
use boxed::BoxAny;
|
||||||
use prelude::*;
|
|
||||||
use result::Result::{Ok, Err};
|
|
||||||
use result;
|
use result;
|
||||||
use std::io::{ChanReader, ChanWriter};
|
use std::io::{ChanReader, ChanWriter};
|
||||||
use string::String;
|
|
||||||
use thunk::Thunk;
|
use thunk::Thunk;
|
||||||
use super::{Thread, Builder};
|
use super::{Thread, Builder};
|
||||||
|
|
||||||
|
@ -745,8 +745,7 @@ mod test {
|
|||||||
use owned_slice::OwnedSlice;
|
use owned_slice::OwnedSlice;
|
||||||
use ast;
|
use ast;
|
||||||
use abi;
|
use abi;
|
||||||
use attr;
|
use attr::{first_attr_value_str_by_name, AttrMetaMethods};
|
||||||
use attr::AttrMetaMethods;
|
|
||||||
use parse::parser::Parser;
|
use parse::parser::Parser;
|
||||||
use parse::token::{str_to_ident};
|
use parse::token::{str_to_ident};
|
||||||
use print::pprust::view_item_to_string;
|
use print::pprust::view_item_to_string;
|
||||||
@ -1195,7 +1194,7 @@ mod test {
|
|||||||
let name = "<source>".to_string();
|
let name = "<source>".to_string();
|
||||||
let source = "/// doc comment\r\nfn foo() {}".to_string();
|
let source = "/// doc comment\r\nfn foo() {}".to_string();
|
||||||
let item = parse_item_from_source_str(name.clone(), source, Vec::new(), &sess).unwrap();
|
let item = parse_item_from_source_str(name.clone(), source, Vec::new(), &sess).unwrap();
|
||||||
let doc = attr::first_attr_value_str_by_name(item.attrs.as_slice(), "doc").unwrap();
|
let doc = first_attr_value_str_by_name(item.attrs.as_slice(), "doc").unwrap();
|
||||||
assert_eq!(doc.get(), "/// doc comment");
|
assert_eq!(doc.get(), "/// doc comment");
|
||||||
|
|
||||||
let source = "/// doc comment\r\n/// line 2\r\nfn foo() {}".to_string();
|
let source = "/// doc comment\r\n/// line 2\r\nfn foo() {}".to_string();
|
||||||
@ -1207,7 +1206,7 @@ mod test {
|
|||||||
|
|
||||||
let source = "/** doc comment\r\n * with CRLF */\r\nfn foo() {}".to_string();
|
let source = "/** doc comment\r\n * with CRLF */\r\nfn foo() {}".to_string();
|
||||||
let item = parse_item_from_source_str(name, source, Vec::new(), &sess).unwrap();
|
let item = parse_item_from_source_str(name, source, Vec::new(), &sess).unwrap();
|
||||||
let doc = attr::first_attr_value_str_by_name(item.attrs.as_slice(), "doc").unwrap();
|
let doc = first_attr_value_str_by_name(item.attrs.as_slice(), "doc").unwrap();
|
||||||
assert_eq!(doc.get(), "/** doc comment\n * with CRLF */");
|
assert_eq!(doc.get(), "/** doc comment\n * with CRLF */");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user