Refactor tests.

This commit is contained in:
Jeff Baskin 2022-07-24 23:11:33 -04:00
parent 4a810a575c
commit fc91e2cd8b

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)] #[cfg(test)]
mod staticstrings { mod staticstrings {
use super::*; use super::*;
@ -51,13 +69,6 @@ mod staticstrings {
field.to_string(), field.to_string(),
data data
); );
let ftype: FieldType = field.into();
assert!(
ftype.to_string() == data,
"\n\nGot: {}\nWant: {}",
ftype.to_string(),
data
);
} }
#[test] #[test]