about summary refs log tree commit diff
path: root/src/librustdoc/trim_pass.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-04-15 20:00:56 -0700
committerbors <bors@rust-lang.org>2013-04-15 20:00:56 -0700
commit16e8af9e477fd5a6e7dcf668840144a97e3b1410 (patch)
tree0aadb938c2b293f149e4501fb26b5da5e6a818c1 /src/librustdoc/trim_pass.rs
parent447caf9bdb8b769581fcd8c337634da431d21954 (diff)
parent40e3577b0834794b2d44e6c527fda90d1adbc88e (diff)
downloadrust-16e8af9e477fd5a6e7dcf668840144a97e3b1410.tar.gz
rust-16e8af9e477fd5a6e7dcf668840144a97e3b1410.zip
auto merge of #5895 : huonw/rust/no-pub-tests, r=thestinger
This patch is a sledge hammer that moves all tests into `#[cfg(test)] mod test { .. }`, and makes them private, there were several instances of `pub mod tests { #[test] pub fn ... } `.

(The reason for this is I was playing with using `syntax` to index code ([result so far](http://www.ug.it.usyd.edu.au/~hwil7821/rust-api/)) and it was getting some junk from the tests.)

The rustdoc commit is particularly brutal, so it's fine if that one isn't landed.
Diffstat (limited to 'src/librustdoc/trim_pass.rs')
-rw-r--r--src/librustdoc/trim_pass.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/librustdoc/trim_pass.rs b/src/librustdoc/trim_pass.rs
index ca543a27189..e56a5f18ac6 100644
--- a/src/librustdoc/trim_pass.rs
+++ b/src/librustdoc/trim_pass.rs
@@ -22,16 +22,6 @@ pub fn mk_pass() -> Pass {
     text_pass::mk_pass(~"trim", |s| s.trim().to_owned() )
 }
 
-#[test]
-fn should_trim_text() {
-    use core::option::Some;
-
-    let doc = test::mk_doc(~"#[doc = \" desc \"] \
-                            mod m {
-                            }");
-    assert!(doc.cratemod().mods()[0].desc() == Some(~"desc"));
-}
-
 #[cfg(test)]
 mod test {
     use astsrv;
@@ -40,11 +30,21 @@ mod test {
     use extract;
     use trim_pass::mk_pass;
 
-    pub fn mk_doc(source: ~str) -> doc::Doc {
+    fn mk_doc(source: ~str) -> doc::Doc {
         do astsrv::from_str(copy source) |srv| {
             let doc = extract::from_srv(srv.clone(), ~"");
             let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
             (mk_pass().f)(srv.clone(), doc)
         }
     }
+
+    #[test]
+    fn should_trim_text() {
+        use core::option::Some;
+
+        let doc = mk_doc(~"#[doc = \" desc \"] \
+                                 mod m {
+}");
+        assert!(doc.cratemod().mods()[0].desc() == Some(~"desc"));
+    }
 }