@@ -484,41 +484,6 @@ func TestPubSub_SelectAuthSilentlyAccepted(t *testing.T) {
484484 }
485485}
486486
487- // TestPubSub_DuplicateSubscribeDoesNotOvercount verifies that subscribing to the
488- // same channel multiple times doesn't inflate the subscription count.
489- func TestPubSub_DuplicateSubscribeDoesNotOvercount (t * testing.T ) {
490- s := newTestSession (newMockDetachedConn ())
491-
492- // First subscribe
493- s .channelSet ["ch1" ] = struct {}{}
494- assert .Equal (t , 1 , s .subCount ())
495-
496- // Duplicate subscribe (idempotent)
497- s .channelSet ["ch1" ] = struct {}{}
498- assert .Equal (t , 1 , s .subCount (), "duplicate subscribe must not increase count" )
499-
500- // Add new channel
501- s .channelSet ["ch2" ] = struct {}{}
502- assert .Equal (t , 2 , s .subCount ())
503- }
504-
505- // TestPubSub_UnsubscribeNonExistent verifies that unsubscribing from a channel
506- // that was never subscribed does not affect the count.
507- func TestPubSub_UnsubscribeNonExistent (t * testing.T ) {
508- s := newTestSession (newMockDetachedConn ())
509-
510- s .channelSet ["ch1" ] = struct {}{}
511- s .channelSet ["ch2" ] = struct {}{}
512-
513- // Delete non-existent: no panic, no effect
514- delete (s .channelSet , "never-subscribed" )
515- assert .Equal (t , 2 , s .subCount ())
516-
517- // Delete existing
518- delete (s .channelSet , "ch1" )
519- assert .Equal (t , 1 , s .subCount ())
520- }
521-
522487// TestPubSub_CleanupClosesUpstream verifies that cleanup closes upstream and dconn.
523488func TestPubSub_CleanupClosesUpstream (t * testing.T ) {
524489 dconn := newMockDetachedConn ()
0 commit comments