about summary refs log tree commit diff
path: root/Test
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
parentcgit url for libmatrix (diff)
downloadModerationClient-d10417339b76bf2750f3e54f4e3b714dd3ed369a.tar.xz
Diffstat (limited to 'Test')
-rw-r--r--Test/Program.cs21
-rw-r--r--Test/Test.csproj18
2 files changed, 39 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
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 @@
+<Project Sdk="Microsoft.NET.Sdk">

+

+  <PropertyGroup>

+    <OutputType>Exe</OutputType>

+    <TargetFramework>net8.0</TargetFramework>

+    <ImplicitUsings>enable</ImplicitUsings>

+    <Nullable>enable</Nullable>

+  </PropertyGroup>

+

+  <ItemGroup>

+    <ProjectReference Include="..\LibMatrix\LibMatrix\LibMatrix.csproj" />

+  </ItemGroup>

+

+  <ItemGroup>

+    <PackageReference Include="BenchmarkDotNet" Version="0.14.0" />

+  </ItemGroup>

+

+</Project>