test configurations

This commit is contained in:
2020-04-19 08:13:55 +01:00
parent d0614b6de2
commit 76e6c2477c
15 changed files with 515 additions and 451 deletions

View File

@@ -79,16 +79,22 @@ impl ToString for Item {
}
}
#[test]
fn test_item_from_string() {
let output = Item::from(include_str!("test-resources/item").to_string());
let expected = crate::mock::item();
assert_eq!(output, expected);
}
#[cfg(test)]
mod test {
use crate::item::Item;
use crate::mock;
#[test]
fn test_item_to_string() {
let output = crate::mock::item().to_string();
let expected = include_str!("test-resources/item").to_string();
assert_eq!(output, expected);
#[test]
fn test_item_from_string() {
let output = Item::from(include_str!("test-resources/item").to_string());
let expected = mock::item();
assert_eq!(output, expected);
}
#[test]
fn test_item_to_string() {
let output = mock::item().to_string();
let expected = include_str!("test-resources/item").to_string();
assert_eq!(output, expected);
}
}