Gather data

This commit is contained in:
mike
2026-01-09 20:02:22 +01:00
parent a2cdddccd9
commit dc331fc96b
2 changed files with 125 additions and 96 deletions

View File

@@ -159,13 +159,15 @@ public class SwedishGeneratorTest {
var a = new int[]{ 1, 3, 5, 7, 9 };
var b = new int[]{ 2, 3, 6, 7, 10 };
var res = SwedishGenerator.intersectSorted(buff, a, a.length, b, b.length);
assertArrayEquals(new int[]{ 3, 7 }, res);
var count = SwedishGenerator.intersectSorted(a, a.length, b, b.length, buff);
assertEquals(2, count);
assertEquals(3, buff[0]);
assertEquals(7, buff[1]);
var c = new int[]{ 1, 2, 3 };
var d = new int[]{ 4, 5, 6 };
res = SwedishGenerator.intersectSorted(buff, c, c.length, d, d.length);
assertEquals(0, res.length);
count = SwedishGenerator.intersectSorted(c, c.length, d, d.length, buff);
assertEquals(0, count);
}
@Test