Skip to content

Commit

Permalink
#757 Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Jun 5, 2023
1 parent 8955d27 commit 2179319
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions main/src/domain/lua_feedback_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,25 +143,21 @@ mod tests {
fn used_props() {
// Given
let text = r#"
if context.mode == 0 then
return {
feedback_event = nil
}
else
return {
used_props = {
"hello",
"bye",
},
}
end
local foo = context.prop("bye")
local bla = context.prop("hello")
return {
feedback_event = nil
}
"#;
let lua = SafeLua::new().unwrap();
let script = LuaFeedbackScript::compile(&lua, text).unwrap();
// When
let used_props = script.used_props().unwrap();
// Then
assert_eq!(used_props, vec!["hello".to_string(), "bye".to_string()]);
assert_eq!(
used_props,
HashSet::from(["hello".to_string(), "bye".to_string()])
);
}

#[test]
Expand Down

0 comments on commit 2179319

Please sign in to comment.