This commit is contained in:
Martin HART 2020-10-30 16:06:22 +01:00
parent 5d4d3a29c7
commit 2fe77a0e2d
1 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@ pub struct World {
pub y: i32, pub y: i32,
} }
pub fn is_instruction(v: &Vec<char>) -> bool { pub fn is_instructions(v: &Vec<char>) -> bool {
for c in v { for c in v {
match c { match c {
'F' => continue, 'F' => continue,
@ -20,14 +20,14 @@ pub fn is_instruction(v: &Vec<char>) -> bool {
mod tests { mod tests {
use super::*; use super::*;
#[test] #[test]
fn is_instruction_test() { fn is_instructions_test() {
let v = vec!['F', 'R', 'L', 'F']; let v = vec!['F', 'R', 'L', 'F'];
assert!(is_instruction(&v)); assert!(is_instructions(&v));
} }
#[test] #[test]
#[should_panic] #[should_panic]
fn is_instruction_test_fail() { fn is_instructions_test_fail() {
let v = vec!['F', 'R', 'L', 'Z']; let v = vec!['F', 'R', 'L', 'Z'];
assert!(is_instruction(&v)); assert!(is_instructions(&v));
} }
} }