diff --git a/tests/mutation_tests.py b/tests/mutation_tests.py index 5d951bc8f..9fdb06a1c 100644 --- a/tests/mutation_tests.py +++ b/tests/mutation_tests.py @@ -434,6 +434,25 @@ MUTATIONS: list[Mutation] = [ test="CapabilityEventsTests.EachEventKindReachesOnlyItsOwnSubscribers", expect="red", ), + # --- Cut 0 (docs/settings-globals-cut.md): Entity must copy the EntitySettings it is given, so no + # entity aliases GameplaySettings.DefaultEntitySettings (or, once settings are a catalog global, the + # cached record itself). --- + Mutation( + rule="control (no-op round trip) for the entity-settings-copy test", + file="Assets/Scripts/ServerShared/Entity.cs", + anchor=" Settings = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(settings));", + mutated=" Settings = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(settings));", + test="LoadoutTests.EntitiesDoNotShareDefaultEntitySettings", + expect="green", + ), + Mutation( + rule="Entity's constructor copies the settings it is given, instead of aliasing the template", + file="Assets/Scripts/ServerShared/Entity.cs", + anchor=" Settings = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(settings));", + mutated=" Settings = settings;", + test="LoadoutTests.EntitiesDoNotShareDefaultEntitySettings", + expect="red", + ), ]