testing updats from statupdate

This commit is contained in:
Nickiel12 2021-12-19 16:59:57 -08:00
parent 227d165e20
commit 9c0f669874

View file

@ -1,5 +1,7 @@
use workctl::sync_flag; use workctl::sync_flag;
use crate::modules::{message_handler::MessageHandler, stream_states::{ stream_states_class::StreamState, enums::Scenes, state_update::StateUpdate}};
#[test] #[test]
fn it_works() { fn it_works() {
@ -9,8 +11,17 @@ fn it_works() {
#[test] #[test]
fn can_make_ctrl_c_handler() { fn can_make_ctrl_c_handler() {
let (control_c_flag_tx, control_c_called_flag_rx) = sync_flag::new_syncflag(false); let (control_c_flag_tx, _control_c_called_flag_rx) = sync_flag::new_syncflag(false);
crate::setup_control_c(control_c_flag_tx); crate::setup_control_c(control_c_flag_tx);
drop(_control_c_called_flag_rx);
} }
#[test]
fn test_updating_state_from_state_update() {
let mut state = StreamState::new();
let update = StateUpdate::Scene(Scenes::Augmented);
//Update handled extensivly in stream_state_tests
state.handle_update(update);
assert_eq!(state.current_scene, Scenes::Augmented);
}