|
@ -33,3 +33,21 @@ fn split_command(commands: &str) -> Vec<&str> { |
|
|
}
|
|
|
}
|
|
|
return vec!["", ""];
|
|
|
return vec!["", ""];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
|
|
mod tests {
|
|
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
fn test_split_command_split(){
|
|
|
|
|
|
let test_string1 = "Hallo, Marcel Davis 1&1.";
|
|
|
|
|
|
assert_eq!(split_command(test_string1),vec!["Hallo,","Marcel Davis 1&1."]);
|
|
|
|
|
|
|
|
|
|
|
|
let test_string2 = "Leiter1 23für Kundenzufriedenheit.";
|
|
|
|
|
|
assert_eq!(split_command(test_string2), vec!["Leiter1", "23für Kundenzufriedenheit."]);
|
|
|
|
|
|
|
|
|
|
|
|
let test_string3 = "Wir# $%gehen erst wieder, wenn ihre Leitung läuft!";
|
|
|
|
|
|
assert_eq!(split_command(test_string3),vec!["Wir#", "$%gehen erst wieder, wenn ihre Leitung läuft!"]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|