Add more tests
This commit is contained in:
parent
4ddbea7194
commit
4a4b0a3343
3 changed files with 4 additions and 3 deletions
|
@ -36,7 +36,7 @@ impl StateChangeHandler {
|
||||||
util::print_result_err("while updating UI based after state change", &result);
|
util::print_result_err("while updating UI based after state change", &result);
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
eprintln!("Error whiel resolving attributes {:?}", err);
|
eprintln!("Error while resolving attributes: {:?}", err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,7 @@ impl ScriptVarHandler {
|
||||||
))?;
|
))?;
|
||||||
} else if event.hangup {
|
} else if event.hangup {
|
||||||
command_out_handles.remove(var_name);
|
command_out_handles.remove(var_name);
|
||||||
|
sources.unregister(var_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -154,14 +154,14 @@ mod test {
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_string_or_var_ref_list() {
|
fn test_parse_string_or_var_ref_list() {
|
||||||
let input = "{{foo}}{{bar}}b{}az{{bat}}{}quok{{test}}";
|
let input = "{{foo}}{{bar}}b{}azb{a}z{{bat}}{}quok{{test}}";
|
||||||
let output = AttrValue::parse_string(input);
|
let output = AttrValue::parse_string(input);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
output,
|
output,
|
||||||
AttrValue(vec![
|
AttrValue(vec![
|
||||||
AttrValueElement::VarRef(VarName("foo".to_owned())),
|
AttrValueElement::VarRef(VarName("foo".to_owned())),
|
||||||
AttrValueElement::VarRef(VarName("bar".to_owned())),
|
AttrValueElement::VarRef(VarName("bar".to_owned())),
|
||||||
AttrValueElement::primitive("b{}az".to_owned()),
|
AttrValueElement::primitive("b{}azb{a}z".to_owned()),
|
||||||
AttrValueElement::VarRef(VarName("bat".to_owned())),
|
AttrValueElement::VarRef(VarName("bat".to_owned())),
|
||||||
AttrValueElement::primitive("{}quok".to_owned()),
|
AttrValueElement::primitive("{}quok".to_owned()),
|
||||||
AttrValueElement::VarRef(VarName("test".to_owned())),
|
AttrValueElement::VarRef(VarName("test".to_owned())),
|
||||||
|
|
Loading…
Add table
Reference in a new issue