Expand unit tests a little more

This commit is contained in:
Jeremy Wall 2018-03-11 15:11:27 -05:00
parent 267b575e8b
commit f2e7a8d7c9
2 changed files with 12 additions and 0 deletions

View File

@ -73,3 +73,5 @@ impl Converter for FlagConverter {
self.write("", &v, &mut w)
}
}
// We need some unit tests for this now :D

View File

@ -590,6 +590,16 @@ mod tokenizer_test {
}
}
#[test]
fn test_tokenize_bareword_with_dash() {
let result = tokenize(LocatedSpan::new("foo-bar "));
assert!(result.is_ok(), format!("result {:?} is not ok", result));
if let Ok(toks) = result {
assert_eq!(toks.len(), 2);
assert_eq!(toks[0].fragment, "foo-bar");
}
}
#[test]
fn test_tokenize_one_of_each() {
let result = tokenize(LocatedSpan::new(