Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#![allow(unused_variables)]
fn main() {}

// ANCHOR: here
#[cfg(test)]
mod tests {
#[test]
Expand All @@ -9,3 +13,4 @@ mod tests {
}
}
}
// ANCHOR_END: here
2 changes: 1 addition & 1 deletion src/ch11-01-writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ that use `Result<T, E>`! Here’s the test from Listing 11-1, rewritten to use
`Result<T, E>` and return an `Err` instead of panicking:

```rust
{{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs}}
{{#rustdoc_include ../listings/ch11-writing-automated-tests/no-listing-10-result-in-tests/src/lib.rs:here}}
```

The `it_works` function now has a return type, `Result<(), String>`. In the
Expand Down