mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-05 10:19:18 +00:00
fix: github actions fmt and test fixes
This commit is contained in:
parent
acf135620b
commit
3526f9dec5
@ -55,7 +55,7 @@ pub struct Exercise {
|
||||
// The hint text associated with the exercise
|
||||
pub hint: String,
|
||||
// The path of the next exercise
|
||||
pub next_path: Option<PathBuf>
|
||||
pub next_path: Option<PathBuf>,
|
||||
}
|
||||
|
||||
// An enum to track of the state of an Exercise.
|
||||
@ -289,6 +289,7 @@ mod test {
|
||||
path: PathBuf::from("tests/fixture/state/pending_exercise.rs"),
|
||||
mode: Mode::Compile,
|
||||
hint: String::from(""),
|
||||
next_path: None,
|
||||
};
|
||||
let compiled = exercise.compile().unwrap();
|
||||
drop(compiled);
|
||||
@ -320,6 +321,7 @@ mod test {
|
||||
path: PathBuf::from("tests/fixture/state/pending_exercise.rs"),
|
||||
mode: Mode::Compile,
|
||||
hint: String::new(),
|
||||
next_path: None,
|
||||
};
|
||||
|
||||
let state = exercise.state();
|
||||
@ -361,6 +363,7 @@ mod test {
|
||||
path: PathBuf::from("tests/fixture/state/finished_exercise.rs"),
|
||||
mode: Mode::Compile,
|
||||
hint: String::new(),
|
||||
next_path: None,
|
||||
};
|
||||
|
||||
assert_eq!(exercise.state(), State::Done);
|
||||
@ -373,6 +376,7 @@ mod test {
|
||||
path: PathBuf::from("tests/fixture/success/testSuccess.rs"),
|
||||
mode: Mode::Test,
|
||||
hint: String::new(),
|
||||
next_path: None,
|
||||
};
|
||||
let out = exercise.compile().unwrap().run().unwrap();
|
||||
assert!(out.stdout.contains("THIS TEST TOO SHALL PASS"));
|
||||
|
||||
@ -247,9 +247,9 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
fn edit_exercises(exercises: &mut Vec<Exercise>){
|
||||
fn edit_exercises(exercises: &mut Vec<Exercise>) {
|
||||
let siz = exercises.len();
|
||||
for i in 0.. siz {
|
||||
for i in 0..siz {
|
||||
if i == siz - 1 {
|
||||
exercises[i].next_path = None;
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user