- Fix pull consumer fetch: send original stream subject in HMSG (not inbox) so NATS client distinguishes data messages from control messages - Fix MaxAge expiry: add background timer in StreamManager for periodic pruning - Fix JetStream wire format: Go-compatible anonymous objects with string enums, proper offset-based pagination for stream/consumer list APIs - Add 42 E2E black-box tests (core messaging, auth, TLS, accounts, JetStream) - Add ~1000 parity tests across all subsystems (gaps closure) - Update gap inventory docs to reflect implementation status
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
using NATS.Server.Subscriptions;
|
|
|
|
namespace NATS.Server.Tests.Subscriptions;
|
|
|
|
public class SubListCtorAndNotificationParityTests
|
|
{
|
|
[Fact]
|
|
public void Constructor_with_enableCache_false_disables_cache()
|
|
{
|
|
var subList = new SubList(enableCache: false);
|
|
|
|
subList.CacheEnabled().ShouldBeFalse();
|
|
}
|
|
|
|
[Fact]
|
|
public void NewSublistNoCache_factory_disables_cache()
|
|
{
|
|
var subList = SubList.NewSublistNoCache();
|
|
|
|
subList.CacheEnabled().ShouldBeFalse();
|
|
}
|
|
|
|
[Fact]
|
|
public void RegisterNotification_emits_true_on_first_interest_and_false_on_last_interest()
|
|
{
|
|
var subList = new SubList();
|
|
var notifications = new List<bool>();
|
|
subList.RegisterNotification(v => notifications.Add(v));
|
|
|
|
var sub = new Subscription { Subject = "foo", Sid = "1" };
|
|
subList.Insert(sub);
|
|
subList.Remove(sub);
|
|
|
|
notifications.ShouldBe([true, false]);
|
|
}
|
|
|
|
[Fact]
|
|
public void SubjectMatch_alias_helpers_match_existing_behavior()
|
|
{
|
|
SubjectMatch.SubjectHasWildcard("foo.*").ShouldBeTrue();
|
|
SubjectMatch.SubjectHasWildcard("foo.bar").ShouldBeFalse();
|
|
|
|
SubjectMatch.IsValidLiteralSubject("foo.bar").ShouldBeTrue();
|
|
SubjectMatch.IsValidLiteralSubject("foo.*").ShouldBeFalse();
|
|
}
|
|
}
|