StringEval se = (StringEval) other;
String stringValue = se.getStringValue();
- if (_wildCardPattern != null) {
+ if (_wildCardPattern != null && (_isMatchFunction || !_matchExact)) {
Matcher matcher = _wildCardPattern.matcher(stringValue);
boolean matches = matcher.matches();
- if (_isMatchFunction ||
- !_matchExact) {
- return CompareResult.valueOf(matches);
- }
+ return CompareResult.valueOf(matches);
}
return CompareResult.valueOf(_value.compareToIgnoreCase(stringValue));
protected abstract void assertColor(String hexExpected, Color actual);
+ protected int defaultDataBarMinLength() { return 0; }
+ protected int defaultDataBarMaxLength() { return 100; }
+
@Test
void testBasic() throws Throwable {
try (Workbook wb = _testDataProvider.createWorkbook()) {
assertNotNull(databar);
assertFalse(databar.isIconOnly());
assertTrue(databar.isLeftToRight());
- assertEquals(0, databar.getWidthMin());
- assertEquals(100, databar.getWidthMax());
+ assertEquals(defaultDataBarMinLength(), databar.getWidthMin());
+ assertEquals(defaultDataBarMaxLength(), databar.getWidthMax());
assertColor(color, databar.getColor());
assertFalse(dbFmt.isIconOnly());
assertTrue(dbFmt.isLeftToRight());
- assertEquals(0, dbFmt.getWidthMin());
- assertEquals(100, dbFmt.getWidthMax());
+ assertEquals(defaultDataBarMinLength(), dbFmt.getWidthMin());
+ assertEquals(defaultDataBarMaxLength(), dbFmt.getWidthMax());
assertColor(colorHex, dbFmt.getColor());
dbFmt.getMinThreshold().setRangeType(RangeType.MIN);
assertFalse(dbFmt.isIconOnly());
assertTrue(dbFmt.isLeftToRight());
- assertEquals(0, dbFmt.getWidthMin());
- assertEquals(100, dbFmt.getWidthMax());
+ assertEquals(defaultDataBarMinLength(), dbFmt.getWidthMin());
+ assertEquals(defaultDataBarMaxLength(), dbFmt.getWidthMax());
assertColor(colorHex, dbFmt.getColor());
assertEquals(RangeType.MIN, dbFmt.getMinThreshold().getRangeType());