diff --git a/src/doc/style/testing/unit.md b/src/doc/style/testing/unit.md index 813660d8fdfb945e90196b3c5518d27688e71ce3..dbbe9fc3ac6da92602304f64de31b07afa01e80a 100644 --- a/src/doc/style/testing/unit.md +++ b/src/doc/style/testing/unit.md @@ -1,10 +1,10 @@ % Unit testing -Unit tests should live in a `test` submodule at the bottom of the module they -test. Mark the `test` submodule with `#[cfg(test)]` so it is only compiled when +Unit tests should live in a `tests` submodule at the bottom of the module they +test. Mark the `tests` submodule with `#[cfg(test)]` so it is only compiled when testing. -The `test` module should contain: +The `tests` module should contain: * Imports needed only for testing. * Functions marked with `#[test]` striving for full coverage of the parent module's @@ -17,7 +17,7 @@ For example: // Excerpt from std::str #[cfg(test)] -mod test { +mod tests { #[test] fn test_eq() { assert!((eq(&"".to_owned(), &"".to_owned()))); diff --git a/src/doc/trpl/testing.md b/src/doc/trpl/testing.md index 8cf126cad95fbd7e4813c92e10bc52367c17b391..45f87a6740597c6ac892c8732b3df881b16d7b42 100644 --- a/src/doc/trpl/testing.md +++ b/src/doc/trpl/testing.md @@ -219,10 +219,10 @@ fn it_works() { This is a very common use of `assert_eq!`: call some function with some known arguments and compare it to the expected output. -# The `test` module +# The `tests` module There is one way in which our existing example is not idiomatic: it's -missing the test module. The idiomatic way of writing our example +missing the `tests` module. The idiomatic way of writing our example looks like this: ```{rust,ignore} @@ -231,7 +231,7 @@ pub fn add_two(a: i32) -> i32 { } #[cfg(test)] -mod test { +mod tests { use super::add_two; #[test] @@ -241,7 +241,7 @@ mod test { } ``` -There's a few changes here. The first is the introduction of a `mod test` with +There's a few changes here. The first is the introduction of a `mod tests` with a `cfg` attribute. The module allows us to group all of our tests together, and to also define helper functions if needed, that don't become a part of the rest of our crate. The `cfg` attribute only compiles our test code if we're @@ -260,7 +260,7 @@ pub fn add_two(a: i32) -> i32 { } #[cfg(test)] -mod test { +mod tests { use super::*; #[test] @@ -279,7 +279,7 @@ $ cargo test Running target/adder-91b3e234d4ed382a running 1 test -test test::it_works ... ok +test tests::it_works ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured @@ -292,7 +292,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured It works! -The current convention is to use the `test` module to hold your "unit-style" +The current convention is to use the `tests` module to hold your "unit-style" tests. Anything that just tests one small bit of functionality makes sense to go here. But what about "integration-style" tests instead? For that, we have the `tests` directory @@ -325,7 +325,7 @@ $ cargo test Running target/adder-91b3e234d4ed382a running 1 test -test test::it_works ... ok +test tests::it_works ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured @@ -346,7 +346,7 @@ test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured Now we have three sections: our previous test is also run, as well as our new one. -That's all there is to the `tests` directory. The `test` module isn't needed +That's all there is to the `tests` directory. The `tests` module isn't needed here, since the whole thing is focused on tests. Let's finally check out that third section: documentation tests. @@ -382,7 +382,7 @@ pub fn add_two(a: i32) -> i32 { } #[cfg(test)] -mod test { +mod tests { use super::*; #[test] @@ -405,7 +405,7 @@ $ cargo test Running target/adder-91b3e234d4ed382a running 1 test -test test::it_works ... ok +test tests::it_works ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index 4c7441b1d2a654534289d69fe672e6364d6657fa..9d1d8a7ac24b8a16a8eb7b8422d7d6f65f36ce66 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -384,7 +384,7 @@ pub fn stats_print() {} } #[cfg(test)] -mod test { +mod tests { extern crate test; use self::test::Bencher; use boxed::Box; diff --git a/src/libcollections/linked_list.rs b/src/libcollections/linked_list.rs index deb1476c23f096375fce6fd7cfeb919e5e322ed4..c73a6f9b324a3698aa7b16063ee31aa4e958a702 100644 --- a/src/libcollections/linked_list.rs +++ b/src/libcollections/linked_list.rs @@ -933,7 +933,7 @@ fn hash(&self, state: &mut H) { } #[cfg(test)] -mod test { +mod tests { use std::clone::Clone; use std::iter::{Iterator, IntoIterator}; use std::option::Option::{Some, None, self}; diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index bbe7830b4238c5fe2518e388f3c326d4ea949070..61369b30dea1797c25d954883c5f988fee433de7 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -1772,7 +1772,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { } #[cfg(test)] -mod test { +mod tests { use core::iter::{Iterator, self}; use core::option::Option::Some; diff --git a/src/libcoretest/num/mod.rs b/src/libcoretest/num/mod.rs index 85ca547da85260bfda02b72c8644362ae853e46f..0ea9f8afb4e532c140a89d882beaf68b59da42d3 100644 --- a/src/libcoretest/num/mod.rs +++ b/src/libcoretest/num/mod.rs @@ -45,7 +45,7 @@ pub fn test_num(ten: T, two: T) where } #[cfg(test)] -mod test { +mod tests { use core::option::Option; use core::option::Option::{Some, None}; use core::num::Float; diff --git a/src/librand/chacha.rs b/src/librand/chacha.rs index 9cd3b74e1552d95adef258408645af0715a20bd6..bcb827cb471cacac023c650ae81a78d147ec83d7 100644 --- a/src/librand/chacha.rs +++ b/src/librand/chacha.rs @@ -202,7 +202,7 @@ fn rand(other: &mut R) -> ChaChaRng { #[cfg(test)] -mod test { +mod tests { use std::prelude::v1::*; use core::iter::order; diff --git a/src/librand/distributions/exponential.rs b/src/librand/distributions/exponential.rs index 5ba6d8912f2672bcf73c58b0863f54fd18a87167..f46d35a33db1a034b2b6190faedf084180b26fa0 100644 --- a/src/librand/distributions/exponential.rs +++ b/src/librand/distributions/exponential.rs @@ -82,7 +82,7 @@ fn ind_sample(&self, rng: &mut R) -> f64 { } #[cfg(test)] -mod test { +mod tests { use std::prelude::v1::*; use distributions::{Sample, IndependentSample}; diff --git a/src/librand/distributions/gamma.rs b/src/librand/distributions/gamma.rs index f37093c6db85bf20a19ad67f428284177f7b575d..2951563934b3c412d273bf4ef91394806fbb41ee 100644 --- a/src/librand/distributions/gamma.rs +++ b/src/librand/distributions/gamma.rs @@ -276,7 +276,7 @@ fn ind_sample(&self, rng: &mut R) -> f64 { } #[cfg(test)] -mod test { +mod tests { use std::prelude::v1::*; use distributions::{Sample, IndependentSample}; diff --git a/src/librand/isaac.rs b/src/librand/isaac.rs index a7f7889783f70b775d40791d669efb547023a4bb..22fe46a8bd83a20e9f78a1a81ec2f47fcfc28c37 100644 --- a/src/librand/isaac.rs +++ b/src/librand/isaac.rs @@ -510,7 +510,7 @@ fn rand(other: &mut R) -> Isaac64Rng { #[cfg(test)] -mod test { +mod tests { use std::prelude::v1::*; use core::iter::order; diff --git a/src/librand/reseeding.rs b/src/librand/reseeding.rs index ea084b2816dd1f349e8a38ff0073841a91cfb498..bb0b13c43756b474cd1603a2d07b329dbdfadd7d 100644 --- a/src/librand/reseeding.rs +++ b/src/librand/reseeding.rs @@ -120,7 +120,7 @@ fn default() -> ReseedWithDefault { ReseedWithDefault } } #[cfg(test)] -mod test { +mod tests { use std::prelude::v1::*; use core::iter::{order, repeat}; diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index f4ea069447fdfc5124a232cac8fe6cea9f5644ee..050ccd6471288ae759c4570657b68f624eec40ea 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1111,7 +1111,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { } #[cfg(test)] -mod test { +mod tests { use session::config::{build_configuration, optgroups, build_session_options}; use session::build_session; diff --git a/src/librustc_back/fs.rs b/src/librustc_back/fs.rs index 2ab4d7ff78a1d256edc6fad38d6e96b17e308412..37e3efb4d83fe112a39c11be151adffb76fdb93a 100644 --- a/src/librustc_back/fs.rs +++ b/src/librustc_back/fs.rs @@ -41,7 +41,7 @@ fn realpath(pathname: *const libc::c_char, resolved: *mut libc::c_char) } #[cfg(all(not(windows), test))] -mod test { +mod tests { use tempdir::TempDir; use std::fs::{self, File}; use super::realpath; diff --git a/src/librustc_back/rpath.rs b/src/librustc_back/rpath.rs index 58073079d31dffcdaf725bc6d7056bfdaaa9de1a..1daeb1cb223e279670efd5d089a07ef87b19a1a3 100644 --- a/src/librustc_back/rpath.rs +++ b/src/librustc_back/rpath.rs @@ -171,7 +171,7 @@ fn minimize_rpaths(rpaths: &[String]) -> Vec { } #[cfg(all(unix, test))] -mod test { +mod tests { use super::{RPathConfig}; use super::{minimize_rpaths, rpaths_to_flags, get_rpath_relative_to_output}; use std::path::{Path, PathBuf}; diff --git a/src/librustc_data_structures/graph/mod.rs b/src/librustc_data_structures/graph/mod.rs index 5741544fe5419638d262839ab3c512d8e4ef4a28..17fd0b81536258d5c229c229c34533bc1789558e 100644 --- a/src/librustc_data_structures/graph/mod.rs +++ b/src/librustc_data_structures/graph/mod.rs @@ -36,7 +36,7 @@ use snapshot_vec::{SnapshotVec, SnapshotVecDelegate}; #[cfg(test)] -mod test; +mod tests; pub struct Graph { nodes: SnapshotVec> , diff --git a/src/librustc_data_structures/graph/test.rs b/src/librustc_data_structures/graph/tests.rs similarity index 100% rename from src/librustc_data_structures/graph/test.rs rename to src/librustc_data_structures/graph/tests.rs diff --git a/src/librustc_data_structures/unify/mod.rs b/src/librustc_data_structures/unify/mod.rs index 7036c010c6580898d87c3973654f454034e54ece..a899bbacc03016f8c624d68c8d18758f90b57c12 100644 --- a/src/librustc_data_structures/unify/mod.rs +++ b/src/librustc_data_structures/unify/mod.rs @@ -14,7 +14,7 @@ use snapshot_vec as sv; #[cfg(test)] -mod test; +mod tests; /// This trait is implemented by any type that can serve as a type /// variable. We call such variables *unification keys*. For example, diff --git a/src/librustc_data_structures/unify/test.rs b/src/librustc_data_structures/unify/tests.rs similarity index 100% rename from src/librustc_data_structures/unify/test.rs rename to src/librustc_data_structures/unify/tests.rs diff --git a/src/librustdoc/html/toc.rs b/src/librustdoc/html/toc.rs index 78feb6c77c45451f8f2df38420c850651825923c..93aa74d7005f6d8989cbae865218d8d421165596 100644 --- a/src/librustdoc/html/toc.rs +++ b/src/librustdoc/html/toc.rs @@ -198,7 +198,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { } #[cfg(test)] -mod test { +mod tests { use super::{TocBuilder, Toc, TocEntry}; #[test] diff --git a/src/libstd/dynamic_lib.rs b/src/libstd/dynamic_lib.rs index d0f990eaf782a5d0c25c17e74ba62e8fd7296334..ef72cbc96e18f54a67652f83bae7e427618304aa 100644 --- a/src/libstd/dynamic_lib.rs +++ b/src/libstd/dynamic_lib.rs @@ -117,7 +117,7 @@ pub unsafe fn symbol(&self, symbol: &str) -> Result<*mut T, String> { } #[cfg(all(test, not(target_os = "ios")))] -mod test { +mod tests { use super::*; use prelude::v1::*; use libc; diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 42fad701533b2b04ad1a228016738c8958c3e629..a9dab8191fd9c90dfa43d3a562e1fc532e6fab84 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -418,7 +418,7 @@ pub fn _print(args: fmt::Arguments) { } #[cfg(test)] -mod test { +mod tests { use thread; use super::*; diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs index c82f9515e8d52813ba494a6b0a48b0b71bc27a65..d797e757a483ecf687d686327ed876a64c987223 100644 --- a/src/libstd/io/util.rs +++ b/src/libstd/io/util.rs @@ -102,7 +102,7 @@ fn flush(&mut self) -> io::Result<()> { Ok(()) } } #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use io::prelude::*; diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index 30d5ae5c6008beb7ba02865df4f745d18c4d6b36..a04bb6705b32167c9329bbce4c1b2d94f065d3d5 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -346,7 +346,7 @@ fn drop(&mut self) { } #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use sync::mpsc::channel; diff --git a/src/libstd/rand/reader.rs b/src/libstd/rand/reader.rs index 2837bac445697348b4472a7034d27e92e193b059..d19bc5b617f8462e62f0ddc5f1c618ccd74d6d0a 100644 --- a/src/libstd/rand/reader.rs +++ b/src/libstd/rand/reader.rs @@ -63,7 +63,7 @@ fn fill_bytes(&mut self, mut v: &mut [u8]) { } #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use super::ReaderRng; diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs index ced84d7551eef349989e897afd1598264288d366..72cbe2b533bb7fc6b62cf366861085d55945e186 100644 --- a/src/libstd/rt/backtrace.rs +++ b/src/libstd/rt/backtrace.rs @@ -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) => ({ diff --git a/src/libstd/sync/future.rs b/src/libstd/sync/future.rs index 2cdde1aca9e682c7696d67ffad62c8f45adaa043..2d281eb4e249ca2be556107d114a100b9c6523f1 100644 --- a/src/libstd/sync/future.rs +++ b/src/libstd/sync/future.rs @@ -155,7 +155,7 @@ pub fn spawn(blk: F) -> Future } #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use sync::mpsc::channel; use sync::Future; diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index b3cc133d229465bf1a3a1b0bdfe988c800c1f02c..74e85db1a06ff1eba3517292ea35281c167ee984 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -1065,7 +1065,7 @@ fn cause(&self) -> Option<&error::Error> { } #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use std::env; diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index b8ad92841f2de65a8a7e8ef3df3a17886829fb6e..58f16a83ba9353d164ec01515f5fd52b6ba391d8 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -346,7 +346,7 @@ fn next(&mut self) -> Option<*mut Handle<'static, ()>> { #[cfg(test)] #[allow(unused_imports)] -mod test { +mod tests { use prelude::v1::*; use thread; diff --git a/src/libstd/sync/mpsc/spsc_queue.rs b/src/libstd/sync/mpsc/spsc_queue.rs index c75ac13080866ce2a0f3376a91cf830af7691ac0..4dd84364fa80ef0634832e194cf4242e04cd9272 100644 --- a/src/libstd/sync/mpsc/spsc_queue.rs +++ b/src/libstd/sync/mpsc/spsc_queue.rs @@ -241,7 +241,7 @@ fn drop(&mut self) { } #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use sync::Arc; diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 5e688717c4a28865cfcde04e427ebcd11c51b1e2..caf011c54f27a1c82b7b766f2a71c5d0bef5441c 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -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; diff --git a/src/libstd/sync/once.rs b/src/libstd/sync/once.rs index 948965f5efa9d157dca85f7e0121eba169546dc0..2ce974c1271aad77cb09b89ddb404caa829075d0 100644 --- a/src/libstd/sync/once.rs +++ b/src/libstd/sync/once.rs @@ -121,7 +121,7 @@ pub fn call_once(&'static self, f: F) where F: FnOnce() { } #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use thread; diff --git a/src/libstd/sys/common/remutex.rs b/src/libstd/sys/common/remutex.rs index b35063c0e234126757410e5d75e97b79f39ca385..00238500c3a85ae77b83230edd26fb3e8e89da5d 100644 --- a/src/libstd/sys/common/remutex.rs +++ b/src/libstd/sys/common/remutex.rs @@ -151,7 +151,7 @@ fn drop(&mut self) { #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use sys_common::remutex::{ReentrantMutex, ReentrantMutexGuard}; use cell::RefCell; diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 28e4650478bb346ddf50d89be06e8f356f069753..9168a716d43801a4304287a81018c18bbb0c48ea 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -722,7 +722,7 @@ fn _assert_both() {} //////////////////////////////////////////////////////////////////////////////// #[cfg(test)] -mod test { +mod tests { use prelude::v1::*; use any::Any; diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 399810cb7f5010ae6d6a4042efadd15bbd347e1e..94dc36b16ba0f53b0282a7410f29db059c95ee50 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1869,7 +1869,7 @@ pub struct MacroDef { } #[cfg(test)] -mod test { +mod tests { use serialize; use super::*; diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 78f06ce5fd5d07f8025a4c5e1b688d0ce32afbcb..720b2095a908af8274da5de043e156d8e589d88d 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -632,7 +632,7 @@ pub fn lit_is_str(lit: &Lit) -> bool { } #[cfg(test)] -mod test { +mod tests { use ast::*; use super::*; diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 34ad192845c58e2f94a6f5d150b81b6e3a893452..5e0cb647c8b41072ff2242d9c4dc9fcc7208f454 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -949,7 +949,7 @@ pub struct MalformedCodemapPositions { // #[cfg(test)] -mod test { +mod tests { use super::*; use std::rc::Rc; diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index d1db956adb3f5a13f28576ff6ac5ceab1802a800..4ea2d4e5c686c8b53115fcf1c2f2aa187c7adedd 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -1553,7 +1553,7 @@ fn visit_mac(&mut self, mac: &ast::Mac) { #[cfg(test)] -mod test { +mod tests { use super::{pattern_bindings, expand_crate}; use super::{PatIdentFinder, IdentRenamer, PatIdentRenamer, ExpansionConfig}; use ast; diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 8ba36cefc65dd49bf80d897d6d8d0ae1399dadc6..c857d4403cbf86b30204307e173d03c91b478f98 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -1343,7 +1343,7 @@ pub fn noop_fold_stmt(Spanned {node, span}: Stmt, folder: &mut T) } #[cfg(test)] -mod test { +mod tests { use std::io; use ast; use util::parser_testing::{string_to_crate, matches_codepattern}; diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index fb3a96f4c2887fdbd2b5c2875d239f50a37c9dc5..1577b50ad760caad882cbbcc98abc894293669e9 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -383,7 +383,7 @@ pub fn gather_comments_and_literals(span_diagnostic: &diagnostic::SpanHandler, } #[cfg(test)] -mod test { +mod tests { use super::*; #[test] fn test_block_doc_comment_1() { diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 8e37b983e21e0425e845223056e33dcecdd6b097..d13ab65d72b2bcd9fb580fd7d1455df01b5bb2c8 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1501,7 +1501,7 @@ fn ident_continue(c: Option) -> bool { } #[cfg(test)] -mod test { +mod tests { use super::*; use codemap::{BytePos, CodeMap, Span, NO_EXPANSION}; diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 1a1713a8ba632fb9fa3d3f99e539525a27266665..dee3e5fee74df918b50fdca691266b75c1979092 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -761,7 +761,7 @@ pub fn integer_lit(s: &str, suffix: Option<&str>, sd: &SpanHandler, sp: Span) -> } #[cfg(test)] -mod test { +mod tests { use super::*; use std::rc::Rc; use codemap::{Span, BytePos, Pos, Spanned, NO_EXPANSION}; diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 2bb74944ce91abf0b085cd932ceb4439e985ae62..538aa3843277ae0ef91978b24aa820859b062613 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -746,7 +746,7 @@ pub fn fresh_mark() -> ast::Mrk { } #[cfg(test)] -mod test { +mod tests { use super::*; use ast; use ext::mtwt; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 5a57e09fcfff2a4fb5b9625da34a5db36e085271..980ce720026c32e5e4c380df1711163aee2f1b2e 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -3008,7 +3008,7 @@ pub fn print_unsafety(&mut self, s: ast::Unsafety) -> io::Result<()> { fn repeat(s: &str, n: usize) -> String { iter::repeat(s).take(n).collect() } #[cfg(test)] -mod test { +mod tests { use super::*; use ast; diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index 6adeb30a94ec4d3c68f8a8af5bfe2d3f2e218edc..d016eb39239f68a64e0154ad5f491b671e5234b6 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -142,7 +142,7 @@ pub fn is_whitespace(c: char) -> bool { } #[cfg(test)] -mod test { +mod tests { use super::*; #[test] fn eqmodws() { diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index 153f9d4a26df155dd4773cb2a22ecdc4a32ae985..5353d12b67813fe483dee91c92409ab2da067a5b 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -204,7 +204,7 @@ fn move_map(self, mut f: F) -> SmallVector where F: FnMut(T) -> T { } #[cfg(test)] -mod test { +mod tests { use super::*; #[test] diff --git a/src/libterm/terminfo/parm.rs b/src/libterm/terminfo/parm.rs index c9ad08bb8523485ae9eb9478dfe97fd71fd8a493..2b8c24741ae7ccb0e2c6b94c61f2f628aed8dbad 100644 --- a/src/libterm/terminfo/parm.rs +++ b/src/libterm/terminfo/parm.rs @@ -573,7 +573,7 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result ,String> { } #[cfg(test)] -mod test { +mod tests { use super::{expand,Param,Words,Variables,Number}; use std::result::Result::Ok; diff --git a/src/libterm/terminfo/parser/compiled.rs b/src/libterm/terminfo/parser/compiled.rs index 3de99088da47b3c653b9dcd6a8de63093b733df6..ef42d8c2506b38ecd8d2b9624f2ce8d84063ea1e 100644 --- a/src/libterm/terminfo/parser/compiled.rs +++ b/src/libterm/terminfo/parser/compiled.rs @@ -345,7 +345,7 @@ pub fn msys_terminfo() -> Box { } #[cfg(test)] -mod test { +mod tests { use super::{boolnames, boolfnames, numnames, numfnames, stringnames, stringfnames}; diff --git a/src/test/run-pass/issue-16597.rs b/src/test/run-pass/issue-16597.rs index d074095dbdedd796e2c1d781c31250415100ae43..7f0a341f147154499f9ac1b28a9608e072121a29 100644 --- a/src/test/run-pass/issue-16597.rs +++ b/src/test/run-pass/issue-16597.rs @@ -11,7 +11,7 @@ // compile-flags:--test // ignore-pretty turns out the pretty-printer doesn't handle gensym'd things... -mod test { +mod tests { use super::*; #[test]