about summary refs log tree commit diff
path: root/Test/Program.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-09-04 05:02:20 +0200
committerRory& <root@rory.gay>2024-09-04 05:02:20 +0200
commitd10417339b76bf2750f3e54f4e3b714dd3ed369a (patch)
tree2f0a51900228f3d4e241f9d8ac3001632ed5305d /Test/Program.cs
parentcgit url for libmatrix (diff)
downloadModerationClient-github/master.tar.xz
Diffstat (limited to 'Test/Program.cs')
-rw-r--r--Test/Program.cs21
1 files changed, 21 insertions, 0 deletions
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<EventIdResponse>(); +// var src2 = new SynapseCollectionResult<EventIdResponse>(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<EventIdResponse>().FromJson(stream1, (item) => { + ArgumentNullException.ThrowIfNull(item.EventId); +}); + +var a = new StateEventResponse(); \ No newline at end of file