]> git.lizzy.rs Git - rust.git/commitdiff
Fixing more doc tests
authorAlex Crichton <alex@alexcrichton.com>
Mon, 23 Dec 2013 06:33:39 +0000 (22:33 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 23 Dec 2013 17:10:37 +0000 (09:10 -0800)
doc/rustdoc.md
src/libextra/glob.rs
src/libstd/comm/select.rs
src/libstd/fmt/mod.rs
src/libstd/io/mod.rs
src/libstd/logging.rs

index 1750d0990097ef19da34c1bbf974c9a5a33e84a1..39fc03bca0d1ef0e54b6be04522eae86d7674d3f 100644 (file)
@@ -132,7 +132,7 @@ specifiers that can be used to dictate how a code block is tested:
 ~~~
 
 Rustdoc also supplies some extra sugar for helping with some tedious
-documentation examples. If a line os prefixed with a `#` character, then the
+documentation examples. If a line is prefixed with a `#` character, then the
 line will not show up in the HTML documentation, but it will be used when
 testing the code block.
 
index bf75fa98b06c9d8b76279131cccecd8b8e6c869f..cb9e53dc69ef43577314a2b8c02479e96e253b11 100644 (file)
@@ -516,7 +516,7 @@ impl MatchOptions {
      *
      * This function always returns this value:
      *
-     * ```rust,notest
+     * ```rust,ignore
      * MatchOptions {
      *     case_sensitive: true,
      *     require_literal_separator: false.
index 9c59a93608563aa3f43da1459882ed32456903ac..bbd4cfea78d7a65d81f7a2f6d7af94b296e7ab0c 100644 (file)
@@ -25,7 +25,7 @@
 //!
 //! # Example
 //!
-//! ```rust,notest
+//! ```rust,ignore
 //! let (mut p1, c1) = Chan::new();
 //! let (mut p2, c2) = Chan::new();
 //!
index e4d45fddacb222eea0100d5773c958936697fd9c..3bbf8031fff93b843eda0c8e4d1d256e0203b618 100644 (file)
@@ -222,7 +222,7 @@ fn main() {
 There are a number of related macros in the `format!` family. The ones that are
 currently implemented are:
 
-```rust,notest
+```rust,ignore
 format!      // described above
 write!       // first argument is a &mut io::Writer, the destination
 writeln!     // same as write but appends a newline
index 03a656ec2c53faa68bde2b35d7962faaa40f4d58..bd0b9e08b7c6d5dbfb74b47e3bdedca1a605c8a7 100644 (file)
@@ -29,6 +29,7 @@
     use std::io::buffered::BufferedReader;
     use std::io::stdin;
 
+    # let _g = ::std::io::ignore_io_error();
     let mut stdin = BufferedReader::new(stdin());
     for line in stdin.lines() {
         print(line);
@@ -40,6 +41,7 @@
     ```rust
     use std::io::File;
 
+    # let _g = ::std::io::ignore_io_error();
     let contents = File::open(&Path::new("message.txt")).read_to_end();
     ```
 
@@ -48,6 +50,7 @@
     ```rust
     use std::io::File;
 
+    # let _g = ::std::io::ignore_io_error();
     let mut file = File::create(&Path::new("message.txt"));
     file.write(bytes!("hello, file!\n"));
     ```
@@ -58,6 +61,7 @@
     use std::io::buffered::BufferedReader;
     use std::io::File;
 
+    # let _g = ::std::io::ignore_io_error();
     let path = Path::new("message.txt");
     let mut file = BufferedReader::new(File::open(&path));
     for line in file.lines() {
@@ -71,6 +75,7 @@
     use std::io::buffered::BufferedReader;
     use std::io::File;
 
+    # let _g = ::std::io::ignore_io_error();
     let path = Path::new("message.txt");
     let mut file = BufferedReader::new(File::open(&path));
     let lines: ~[~str] = file.lines().collect();
   XXX This needs more improvement: TcpStream constructor taking &str,
   `write_str` and `write_line` methods.
 
-    ```rust,ignore
+    ```rust,should_fail
     use std::io::net::ip::SocketAddr;
     use std::io::net::tcp::TcpStream;
 
+    # let _g = ::std::io::ignore_io_error();
     let addr = from_str::<SocketAddr>("127.0.0.1:8080").unwrap();
     let mut socket = TcpStream::connect(addr).unwrap();
     socket.write(bytes!("GET / HTTP/1.0\n\n"));
index 59e57a8680d8ff8fbc268ceba935f2edaac04ab8..dbe8b3247c0b4c09fed120ad16902cf81b020acd 100644 (file)
@@ -78,7 +78,7 @@
 
 Each of these macros will expand to code similar to:
 
-```rust,notest
+```rust,ignore
 if log_level <= my_module_log_level() {
     ::std::logging::log(log_level, format!(...));
 }