aboutsummaryrefslogtreecommitdiff
path: root/tests/sync_watch.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sync_watch.rs')
-rw-r--r--tests/sync_watch.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/sync_watch.rs b/tests/sync_watch.rs
index a2a276d..b7bbaf7 100644
--- a/tests/sync_watch.rs
+++ b/tests/sync_watch.rs
@@ -186,3 +186,18 @@ fn borrow_and_update() {
assert_eq!(*rx.borrow_and_update(), "three");
assert_ready!(spawn(rx.changed()).poll()).unwrap_err();
}
+
+#[test]
+fn reopened_after_subscribe() {
+ let (tx, rx) = watch::channel("one");
+ assert!(!tx.is_closed());
+
+ drop(rx);
+ assert!(tx.is_closed());
+
+ let rx = tx.subscribe();
+ assert!(!tx.is_closed());
+
+ drop(rx);
+ assert!(tx.is_closed());
+}