fix comparison logic

This commit is contained in:
Grahame Grieve 2023-08-21 11:06:04 +10:00
parent 6d3e555620
commit 2c6be77ee2
2 changed files with 11 additions and 2 deletions

View File

@ -3220,6 +3220,12 @@ public class ValueSet extends MetadataResource {
}
@Override
public String toString() {
var s = (hasValue() ? getValue().primitiveValue() : "");
return getName() + "=" + s;
}
}
@Block()

View File

@ -349,11 +349,12 @@ public class CompareUtilities extends BaseTestingUtilities {
} else if (actualJsonElement instanceof JsonArray) {
JsonArray actualArray = (JsonArray) actualJsonElement;
JsonArray expectedArray = (JsonArray) expectedJsonElement;
int expectedMin = countExpectedMin(expectedArray);
int as = actualArray.size();
int es = expectedArray.size();
int oc = optionalCount(expectedArray);
if (as > es || as < expectedMin)
return createNotEqualMessage("array item count differs at " + path, Integer.toString(es), Integer.toString(as));
int c = 0;
@ -373,7 +374,9 @@ public class CompareUtilities extends BaseTestingUtilities {
c++;
}
}
if (c < as) {
return "Unexpected Node found in array at index "+c;
}
} else
return "unhandled property " + actualJsonElement.getClass().getName();
return null;