mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-11-29 22:47:43 +02:00
Merge branch 'master' into refactor-hints
This commit is contained in:
0
tests/fixture/state/finished_exercise.rs
Normal file
0
tests/fixture/state/finished_exercise.rs
Normal file
7
tests/fixture/state/pending_exercise.rs
Normal file
7
tests/fixture/state/pending_exercise.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
// fake_exercise
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
use assert_cmd::prelude::*;
|
||||
use glob::glob;
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::process::Command;
|
||||
|
||||
#[test]
|
||||
@@ -115,4 +118,20 @@ fn get_hint_for_single_test() {
|
||||
.assert()
|
||||
.code(0)
|
||||
.stdout("Hello!\n");
|
||||
|
||||
#[test]
|
||||
fn all_exercises_require_confirmation() {
|
||||
for exercise in glob("exercises/**/*.rs").unwrap() {
|
||||
let path = exercise.unwrap();
|
||||
let source = {
|
||||
let mut file = File::open(&path).unwrap();
|
||||
let mut s = String::new();
|
||||
file.read_to_string(&mut s).unwrap();
|
||||
s
|
||||
};
|
||||
source.matches("// I AM NOT DONE").next().expect(&format!(
|
||||
"There should be an `I AM NOT DONE` annotation in {:?}",
|
||||
path
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user