|
@@ -37,6 +37,11 @@ public class FastMapTest {
|
|
|
return forEachType(TestData::testBasic);
|
|
|
}
|
|
|
|
|
|
+ @TestFactory
|
|
|
+ public Stream<DynamicTest> testWithInvalid() {
|
|
|
+ return forEachType(TestData::testWithInvalid);
|
|
|
+ }
|
|
|
+
|
|
|
@TestFactory
|
|
|
public Stream<DynamicTest> testWith() {
|
|
|
return forEachType(TestData::testWith);
|
|
@@ -129,6 +134,13 @@ public class FastMapTest {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void testWithInvalid() {
|
|
|
+ for (Map<Property<?>, Comparable<?>> baseMap : values.keySet()) {
|
|
|
+ final int baseIndex = map.getIndexOf(baseMap);
|
|
|
+ Assertions.assertNull(map.with(baseIndex, INT, 8));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private <T extends Comparable<T>>
|
|
|
void testSwaps(int baseIndex, Property<T> toSwap, Map<Property<?>, Comparable<?>> baseMap) {
|
|
|
Map<Property<?>, Comparable<?>> expected = new HashMap<>(baseMap);
|