Skip to content

the first example 'cargo test' can not work #1665

Open
@dlintw

Description

@dlintw

https://doc.rust-lang.org/stable/rust-by-example/testing/unit_testing.html

I just do copy the first unit test sample into a file named t.rs, then run 'cargo test', it report error.

After read the book, I change the process to

cargo new --lib add
cd add
vim src/lib.rs  ## copy & paste the example code here
cargo test   # it works now.

My suggestion is do a brief description about how to play the 'unittest' code, to let those readers who still not read the book can also complete the examples.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions