test configurations
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user