Hi,

I'm trying to get started with rust 0.5.  I've got it built and can
compile+execute some simple programs.  Now I want to get running with test
driven development, so I just want to write, build, and run a simple unit
test... according to the documentation+wiki, the following is the minimal
unit test:

$ cat test.rs
// sample
#[test]
fn testFail() {
    fail;
}

And the --test option is supposed to build a harness to run everything
marked with attribute #[test]:

$ rustc test.rs --test
test.rs:1:0: 1:0 error: unresolved name
test.rs:1 // sample
          ^
test.rs:1:0: 1:0 error: use of undeclared module `std::test`
test.rs:1 // sample
          ^
test.rs:1:0: 1:0 error: unresolved name: std::test::test_main
test.rs:1 // sample
          ^
test.rs:1:0: 1:0 error: unresolved name
test.rs:1 // sample
          ^
test.rs:1:0: 1:0 error: use of undeclared module `std::test`
test.rs:1 // sample
          ^
test.rs:1:0: 1:0 error: use of undeclared type name `std::test::TestDesc`
test.rs:1 // sample
          ^
Can someone point me in the right direction here?

Thanks,
David
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to