diff --git a/src/Ivy.NativeJsonDiff.Benchmarks/Benchmarks/JsonApplyBenchmarks.cs b/src/Ivy.NativeJsonDiff.Benchmarks/Benchmarks/JsonApplyBenchmarks.cs index f95ccd3..bd2467f 100644 --- a/src/Ivy.NativeJsonDiff.Benchmarks/Benchmarks/JsonApplyBenchmarks.cs +++ b/src/Ivy.NativeJsonDiff.Benchmarks/Benchmarks/JsonApplyBenchmarks.cs @@ -14,7 +14,7 @@ namespace Ivy.NativeJsonDiff.Benchmarks.Benchmarks; [MarkdownExporterAttribute.GitHub] public class JsonApplyBenchmarks { - [Params("Small", "Medium", "Large", "DeepNested", "ArrayHeavy", "ApiResponse", "ConfigFile", "LargeStateTree")] + [Params("Small", "Medium", "Large", "DeepNested", "ArrayHeavy", "ApiResponse", "ConfigFile", "LargeStateTree", "VeryLargeStateTree")] public string Category { get; set; } = null!; private byte[] _oldBytes = null!; diff --git a/src/Ivy.NativeJsonDiff.Tests/JsonPayloadGeneratorTests.cs b/src/Ivy.NativeJsonDiff.Tests/JsonPayloadGeneratorTests.cs index 9055e26..28c0a85 100644 --- a/src/Ivy.NativeJsonDiff.Tests/JsonPayloadGeneratorTests.cs +++ b/src/Ivy.NativeJsonDiff.Tests/JsonPayloadGeneratorTests.cs @@ -15,6 +15,7 @@ public class JsonPayloadGeneratorTests [InlineData("ApiResponse")] [InlineData("ConfigFile")] [InlineData("LargeStateTree")] + [InlineData("VeryLargeStateTree")] public void Generate_ProducesValidJson(string category) { var (oldBytes, newBytes) = JsonPayloadGenerator.Generate(category); @@ -58,6 +59,15 @@ public void Generate_LargeStateTree_HasExpectedSize() Assert.InRange(newBytes.Length, 20_000, 200_000); } + [Fact] + public void Generate_VeryLargeStateTree_HasExpectedSize() + { + var (oldBytes, newBytes) = JsonPayloadGenerator.Generate("VeryLargeStateTree"); + // ~1MB expected + Assert.InRange(oldBytes.Length, 500_000, 5_000_000); + Assert.InRange(newBytes.Length, 500_000, 5_000_000); + } + [Fact] public void Generate_OldAndNew_AreDifferent() { @@ -76,7 +86,8 @@ public void AllCategories_ContainsExpectedEntries() Assert.Contains("ApiResponse", JsonPayloadGenerator.AllCategories); Assert.Contains("ConfigFile", JsonPayloadGenerator.AllCategories); Assert.Contains("LargeStateTree", JsonPayloadGenerator.AllCategories); - Assert.Equal(8, JsonPayloadGenerator.AllCategories.Length); + Assert.Contains("VeryLargeStateTree", JsonPayloadGenerator.AllCategories); + Assert.Equal(9, JsonPayloadGenerator.AllCategories.Length); } [Fact]