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

@@ -21,24 +21,29 @@ impl ToString for Variable {
}
}
#[test]
fn test_variable_from_string() {
assert_eq!(
Variable::from("VAR a\n42".to_string()),
Variable {
id: "a".to_string(),
initial_value: "42".to_string()
}
);
}
#[cfg(test)]
mod test {
use crate::variable::Variable;
#[test]
fn test_variable_to_string() {
let output = Variable {
id: "c".to_string(),
initial_value: "57".to_string(),
#[test]
fn test_variable_from_string() {
assert_eq!(
Variable::from("VAR a\n42".to_string()),
Variable {
id: "a".to_string(),
initial_value: "42".to_string()
}
);
}
#[test]
fn test_variable_to_string() {
let output = Variable {
id: "c".to_string(),
initial_value: "57".to_string(),
}
.to_string();
let expected = "VAR c\n57".to_string();
assert_eq!(output, expected);
}
.to_string();
let expected = "VAR c\n57".to_string();
assert_eq!(output, expected);
}