diff options
| author | Chris Pearce <christopher.james.pearce@gmail.com> | 2019-04-07 17:49:34 +0100 |
|---|---|---|
| committer | Chris Pearce <christopher.james.pearce@gmail.com> | 2019-04-07 20:13:04 +0100 |
| commit | 3d11d7685b2c3478c35a09fbb7543c03f5043bbe (patch) | |
| tree | 31a7169226cba7c027653ad184e7bd57ea34e9dd /tests/integration_tests.rs | |
| parent | fbd0ccbd5b7c86846e2488bf4d8dce0b1b90b04e (diff) | |
Modify integration tests to fail on panic
Diffstat (limited to 'tests/integration_tests.rs')
| -rw-r--r-- | tests/integration_tests.rs | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 01c4744..a077918 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -13,7 +13,7 @@ fn fails_when_in_wrong_dir() { .unwrap() .current_dir("tests/") .assert() - .failure(); + .code(1); } #[test] @@ -21,39 +21,69 @@ fn verify_all_success() { Command::cargo_bin("rustlings") .unwrap() .arg("v") - .current_dir("tests/fixture/") + .current_dir("tests/fixture/success") .assert() .success(); } #[test] +fn verify_all_failure() { + Command::cargo_bin("rustlings") + .unwrap() + .arg("v") + .current_dir("tests/fixture/failure") + .assert() + .code(1); +} + +#[test] fn run_single_compile_success() { Command::cargo_bin("rustlings") .unwrap() .args(&["r", "compSuccess.rs"]) - .current_dir("tests/fixture/") + .current_dir("tests/fixture/success/") .assert() .success(); } #[test] +fn run_single_compile_failure() { + Command::cargo_bin("rustlings") + .unwrap() + .args(&["r", "compFailure.rs"]) + .current_dir("tests/fixture/failure/") + .assert() + .code(1); +} + +#[test] fn run_single_test_success() { Command::cargo_bin("rustlings") .unwrap() .args(&["r", "testSuccess.rs"]) - .current_dir("tests/fixture/") + .current_dir("tests/fixture/success/") .assert() .success(); } #[test] +fn run_single_test_failure() { + Command::cargo_bin("rustlings") + .unwrap() + .args(&["r", "testFailure.rs"]) + .current_dir("tests/fixture/failure/") + .assert() + .code(1); +} + +#[test] fn run_single_test_no_filename() { Command::cargo_bin("rustlings") .unwrap() .arg("r") .current_dir("tests/fixture/") .assert() - .failure(); + .code(1); } #[test] @@ -61,7 +91,7 @@ fn run_single_test_no_exercise() { Command::cargo_bin("rustlings") .unwrap() .args(&["r", "compNoExercise.rs"]) - .current_dir("tests/fixture/") + .current_dir("tests/fixture/failure") .assert() - .failure(); + .code(1); } |
