mirror of
https://github.com/rust-lang/rustlings.git
synced 2024-12-25 15:10:26 +00:00
test: Add integration tests
This commit is contained in:
parent
6f44cb1dd2
commit
0aff5340b5
1 changed files with 22 additions and 1 deletions
|
@ -110,6 +110,27 @@ fn run_single_test_no_exercise() {
|
|||
.code(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reset_single_exercise() {
|
||||
Command::cargo_bin("rustlings")
|
||||
.unwrap()
|
||||
.args(&["reset", "intro1"])
|
||||
.assert()
|
||||
.code(0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reset_no_exercise() {
|
||||
Command::cargo_bin("rustlings")
|
||||
.unwrap()
|
||||
.arg("reset")
|
||||
.assert()
|
||||
.code(1)
|
||||
.stderr(predicates::str::contains(
|
||||
"positional arguments not provided",
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn get_hint_for_single_test() {
|
||||
Command::cargo_bin("rustlings")
|
||||
|
@ -126,7 +147,7 @@ fn all_exercises_require_confirmation() {
|
|||
for exercise in glob("exercises/**/*.rs").unwrap() {
|
||||
let path = exercise.unwrap();
|
||||
if path.file_name().unwrap() == "mod.rs" {
|
||||
continue
|
||||
continue;
|
||||
}
|
||||
let source = {
|
||||
let mut file = File::open(&path).unwrap();
|
||||
|
|
Loading…
Reference in a new issue