Auto merge of #24783 - jooert:unittestguidelines, r=alexcrichton
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest (see #23870, #24030 and http://users.rust-lang.org/t/guidelines-naming-of-unit-test-module/1078 for previous discussions). r? @alexcrichton
This commit is contained in:
commit
e3d00a4980
48 changed files with 59 additions and 59 deletions
|
|
@ -117,7 +117,7 @@ impl DynamicLibrary {
|
|||
}
|
||||
|
||||
#[cfg(all(test, not(target_os = "ios")))]
|
||||
mod test {
|
||||
mod tests {
|
||||
use super::*;
|
||||
use prelude::v1::*;
|
||||
use libc;
|
||||
|
|
|
|||
|
|
@ -418,7 +418,7 @@ pub fn _print(args: fmt::Arguments) {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use thread;
|
||||
use super::*;
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ impl Write for Sink {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use io::prelude::*;
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ mod imp {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::mpsc::channel;
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ impl<R: Read> Rng for ReaderRng<R> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use super::ReaderRng;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ pub fn log_enabled() -> bool {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use sys_common;
|
||||
macro_rules! t { ($a:expr, $b:expr) => ({
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ impl<A:Send+'static> Future<A> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use sync::mpsc::channel;
|
||||
use sync::Future;
|
||||
|
|
|
|||
|
|
@ -1065,7 +1065,7 @@ impl error::Error for TryRecvError {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use std::env;
|
||||
|
|
|
|||
|
|
@ -346,7 +346,7 @@ impl Iterator for Packets {
|
|||
|
||||
#[cfg(test)]
|
||||
#[allow(unused_imports)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use thread;
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ impl<T> Drop for Queue<T> {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::Arc;
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ pub fn guard_poison<'a, T>(guard: &MutexGuard<'a, T>) -> &'a poison::Flag {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use sync::mpsc::channel;
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ impl Once {
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use thread;
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ impl<'a, T> Drop for ReentrantMutexGuard<'a, T> {
|
|||
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
use sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard};
|
||||
use cell::RefCell;
|
||||
|
|
|
|||
|
|
@ -722,7 +722,7 @@ fn _assert_sync_and_send() {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
mod tests {
|
||||
use prelude::v1::*;
|
||||
|
||||
use any::Any;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue