surpressed all style warnings from the LSP server.

This commit is contained in:
Linus Björnstam 2026-05-21 13:13:22 +02:00
parent 7ee2238248
commit 23c4ac299e
13 changed files with 346 additions and 371 deletions

View file

@ -19,25 +19,25 @@ public class BTreeFuzzTests
public void Fuzz_Insert_And_Remove_consistency()
{
// CONFIGURATION
const int Iterations = 100_000; // High enough to trigger all splits/merges
const int KeyRange = 5000; // Small enough to cause frequent collisions
const int iterations = 100_000; // High enough to trigger all splits/merges
const int keyRange = 5000; // Small enough to cause frequent collisions
const bool showOps = false;
int Seed = 2135974; // Environment.TickCount;
int seed = 2135974; // Environment.TickCount;
// ORACLES
var reference = new SortedDictionary<int, int>();
var subject = BaseOrderedMap<int, int, IntStrategy>.CreateTransient(_strategy);
var random = new Random(Seed);
_output.WriteLine($"Starting Fuzz Test with Seed: {Seed}");
var random = new Random(seed);
_output.WriteLine($"Starting Fuzz Test with Seed: {seed}");
try
{
for (int i = 0; i < Iterations; i++)
for (int i = 0; i < iterations; i++)
{
// 1. Pick an Action: 70% Insert/Update, 30% Remove
bool isInsert = random.NextDouble() < 0.7;
int key = random.Next(KeyRange);
int key = random.Next(keyRange);
int val = key * 100;
if (isInsert)
@ -82,7 +82,7 @@ public class BTreeFuzzTests
}
catch (Exception)
{
_output.WriteLine($"FAILED at iteration with SEED: {Seed}");
_output.WriteLine($"FAILED at iteration with SEED: {seed}");
throw; // Re-throw to fail the test
}
}
@ -91,28 +91,28 @@ public class BTreeFuzzTests
public void Fuzz_Range_Queries()
{
// Validates that your Range Enumerator matches LINQ on the reference
const int Iterations = 1000;
const int KeyRange = 2000;
int Seed = Environment.TickCount;
const int iterations = 1000;
const int keyRange = 2000;
int seed = Environment.TickCount;
var reference = new SortedDictionary<int, int>();
var subject = BaseOrderedMap<int, int, IntStrategy>.CreateTransient(_strategy);
var random = new Random(Seed);
var random = new Random(seed);
// Fill Data
for(int i=0; i<KeyRange; i++)
for(int i=0; i<keyRange; i++)
{
int k = random.Next(KeyRange);
int k = random.Next(keyRange);
reference[k] = k;
subject.Set(k, k);
}
var persistent = subject.ToPersistent();
for (int i = 0; i < Iterations; i++)
for (int i = 0; i < iterations; i++)
{
int min = random.Next(KeyRange);
int max = min + random.Next(KeyRange - min); // Ensure max >= min
int min = random.Next(keyRange);
int max = min + random.Next(keyRange - min); // Ensure max >= min
// 1. Reference Result (LINQ)
// Note: SortedDictionary doesn't have a direct Range query, so we filter memory.