Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch11-03: Unnecessary import removal #3284

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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,5 +1,3 @@
use adder;

#[test]
fn it_adds_two() {
assert_eq!(4, adder::add_two(2));
Expand Down
4 changes: 0 additions & 4 deletions src/ch11-03-test-organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ Enter the code in Listing 11-13 into the *tests/integration_test.rs* file:
<span class="caption">Listing 11-13: An integration test of a function in the
`adder` crate</span>

Each file in the `tests` directory is a separate crate, so we need to bring our
library into each test crate’s scope. For that reason we add `use adder` at the
top of the code, which we didn’t need in the unit tests.

We don’t need to annotate any code in *tests/integration_test.rs* with
`#[cfg(test)]`. Cargo treats the `tests` directory specially and compiles files
in this directory only when we run `cargo test`. Run `cargo test` now:
Expand Down