Refactor tests.

This commit is contained in:
Jeff Baskin 2022-07-24 23:11:33 -04:00
parent 4a810a575c
commit fc91e2cd8b
1 changed files with 18 additions and 7 deletions

View File

@ -37,6 +37,24 @@ impl fmt::Display for StaticString {
}
}
#[cfg(test)]
mod fieldtypes {
use super::*;
#[test]
fn convert_static_string() {
let data = "a static string";
let field = StaticString::new(data);
let ftype: FieldType = field.into();
assert!(
ftype.to_string() == data,
"\n\nGot: {}\nWant: {}",
ftype.to_string(),
data
);
}
}
#[cfg(test)]
mod staticstrings {
use super::*;
@ -51,13 +69,6 @@ mod staticstrings {
field.to_string(),
data
);
let ftype: FieldType = field.into();
assert!(
ftype.to_string() == data,
"\n\nGot: {}\nWant: {}",
ftype.to_string(),
data
);
}
#[test]