Provoke testbench fail to ensure the CI notices errors
Run the tests for a working verification of xtcl. / build (ubuntu-20.04) (push) Failing after 50s
Details
Run the tests for a working verification of xtcl. / build (ubuntu-20.04) (push) Failing after 50s
Details
This commit is contained in:
parent
e73933f21f
commit
ac23fedf24
|
@ -32,3 +32,11 @@ pub fn commands(tcl: &str) -> Vec<String> {
|
||||||
|
|
||||||
return commands;
|
return commands;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @name words
|
||||||
|
// @return Vec<String>
|
||||||
|
// @brief Split command into words.
|
||||||
|
// @param command: &str
|
||||||
|
pub fn words(command: &str) -> Vec<String> {
|
||||||
|
vec![]
|
||||||
|
}
|
||||||
|
|
16
src/tests.rs
16
src/tests.rs
|
@ -1,5 +1,5 @@
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
use crate::tcl::commands;
|
use crate::tcl::{commands, words};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_commands_working() {
|
fn test_commands_working() {
|
||||||
|
@ -38,3 +38,17 @@ fn test_commands_quotes() {
|
||||||
assert_eq!(case_2, verify_2);
|
assert_eq!(case_2, verify_2);
|
||||||
assert_eq!(case_3, verify_3);
|
assert_eq!(case_3, verify_3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_words_simple() {
|
||||||
|
let testcase: &str = "routine argument 1234 0x123 abcd";
|
||||||
|
let verify: Vec<String> = vec![
|
||||||
|
String::from("routine"),
|
||||||
|
String::from("argument"),
|
||||||
|
String::from("1234"),
|
||||||
|
String::from("0x123"),
|
||||||
|
String::from("abcd"),
|
||||||
|
];
|
||||||
|
let case: Vec<String> = words(testcase);
|
||||||
|
assert_eq!(case, verify);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue