]> git.lizzy.rs Git - rust.git/commitdiff
book: use `mod test` consistently
authorDan Callahan <dan.callahan@gmail.com>
Sat, 4 Apr 2015 03:38:30 +0000 (22:38 -0500)
committerDan Callahan <dan.callahan@gmail.com>
Sat, 4 Apr 2015 03:48:00 +0000 (22:48 -0500)
Fixes #24030

Of the four code samples with modules in TRPL:

    - 2 use `mod test`
    - 2 use `mod tests`

We should be consistent here, but which is right? The stdlib is split:

    $ grep -r 'mod tests {' src/lib* | wc -l
          63
    $ grep -r 'mod test {'  src/lib* | wc -l
          58

Subjectively, I like the plural, but both the language reference and the
style guide recommend the singular. So we'll go with that here, for now.

src/doc/trpl/benchmark-tests.md
src/doc/trpl/testing.md

index 887965375932b3fe4953179a96d4dd54ec23c32e..890a2f8ae7de7d29b3dbd14bf867ca83f7c02563 100644 (file)
@@ -13,7 +13,7 @@ pub fn add_two(a: i32) -> i32 {
 }
 
 #[cfg(test)]
-mod tests {
+mod test {
     use super::*;
     use test::Bencher;
 
index fddb4c19031726f51f9dfe0930c40dbb4ff538fb..8cf126cad95fbd7e4813c92e10bc52367c17b391 100644 (file)
@@ -382,7 +382,7 @@ pub fn add_two(a: i32) -> i32 {
 }
 
 #[cfg(test)]
-mod tests {
+mod test {
     use super::*;
 
     #[test]