From d10417339b76bf2750f3e54f4e3b714dd3ed369a Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 4 Sep 2024 05:02:20 +0200 Subject: Changes --- Test/Program.cs | 21 +++++++++++++++++++++ Test/Test.csproj | 18 ++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Test/Program.cs create mode 100644 Test/Test.csproj (limited to 'Test') diff --git a/Test/Program.cs b/Test/Program.cs new file mode 100644 index 0000000..2739294 --- /dev/null +++ b/Test/Program.cs @@ -0,0 +1,21 @@ +using System.Text.Json; +using LibMatrix; +using LibMatrix.Homeservers.ImplementationDetails.Synapse.Models.Responses; + +// var src1 = new SynapseCollectionResult(); +// var src2 = new SynapseCollectionResult(chunkKey: "meow", nextTokenKey: "woof", prevTokenKey: "bark", totalKey: "purr"); +// +// for (int i = 0; i < 10000000; i++) { +// src1.Chunk.Add(new EventIdResponse { EventId = Guid.NewGuid().ToString() }); +// src2.Chunk.Add(new EventIdResponse { EventId = Guid.NewGuid().ToString() }); +// } +// +// File.WriteAllText("src1.json", JsonSerializer.Serialize(src1, new JsonSerializerOptions(){WriteIndented = true})); +// File.WriteAllText("src2.json", JsonSerializer.Serialize(src2, new JsonSerializerOptions(){WriteIndented = true})); + +using var stream1 = File.OpenRead("src1.json"); +var dst1 = new SynapseCollectionResult().FromJson(stream1, (item) => { + ArgumentNullException.ThrowIfNull(item.EventId); +}); + +var a = new StateEventResponse(); \ No newline at end of file diff --git a/Test/Test.csproj b/Test/Test.csproj new file mode 100644 index 0000000..39961c1 --- /dev/null +++ b/Test/Test.csproj @@ -0,0 +1,18 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + + + + -- cgit 1.4.1