diff --git a/reactive_graph/tests/signal.rs b/reactive_graph/tests/signal.rs index 0052dd1328..d2b7c9f624 100644 --- a/reactive_graph/tests/signal.rs +++ b/reactive_graph/tests/signal.rs @@ -2,7 +2,7 @@ use reactive_graph::{ owner::Owner, signal::{arc_signal, signal, ArcRwSignal, RwSignal}, traits::{ - Get, GetUntracked, Read, Set, Update, UpdateUntracked, With, + Get, GetUntracked, IntoInner, Read, Set, Update, UpdateUntracked, With, WithUntracked, Write, }, }; @@ -108,3 +108,24 @@ fn update_signal() { set_a.set(4); assert_eq!(a.get(), 4); } + +#[test] +fn into_inner_signal() { + let owner = Owner::new(); + owner.set(); + + let rw_signal = RwSignal::new(1); + assert_eq!(rw_signal.get(), 1); + assert_eq!(rw_signal.into_inner(), Some(1)); +} + +#[test] +fn into_inner_arc_signal() { + let owner = Owner::new(); + owner.set(); + + let (a, b) = arc_signal(2); + assert_eq!(a.get(), 2); + std::mem::drop(b); + assert_eq!(a.into_inner(), Some(2)); +}