Fix native is boolean filter cache key tests to test the right thing (#15216)

This commit is contained in:
Clint Wylie 2023-10-22 22:54:46 -07:00 committed by GitHub
parent 33fdd770f7
commit c8e458452d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -52,11 +52,15 @@ public class IsBooleanDimFilterTest extends InitializedNullHandlingTest
@Test @Test
public void testGetCacheKey() public void testGetCacheKey()
{ {
EqualityFilter f1 = new EqualityFilter("x", ColumnType.STRING, "hello", null); IsTrueDimFilter f1 = IsTrueDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", null));
EqualityFilter f1_2 = new EqualityFilter("x", ColumnType.STRING, "hello", null); IsTrueDimFilter f1_2 = IsTrueDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", null));
EqualityFilter f2 = new EqualityFilter("x", ColumnType.STRING, "world", null); IsFalseDimFilter f1_3 = IsFalseDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", null));
EqualityFilter f3 = new EqualityFilter("x", ColumnType.STRING, "hello", new FilterTuning(true, null, null)); IsFalseDimFilter f1_4 = IsFalseDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", null));
IsTrueDimFilter f2 = IsTrueDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "world", null));
IsTrueDimFilter f3 = IsTrueDimFilter.of(new EqualityFilter("x", ColumnType.STRING, "hello", new FilterTuning(true, null, null)));
Assert.assertArrayEquals(f1.getCacheKey(), f1_2.getCacheKey()); Assert.assertArrayEquals(f1.getCacheKey(), f1_2.getCacheKey());
Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f1_3.getCacheKey()));
Assert.assertArrayEquals(f1_3.getCacheKey(), f1_4.getCacheKey());
Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f2.getCacheKey())); Assert.assertFalse(Arrays.equals(f1.getCacheKey(), f2.getCacheKey()));
Assert.assertArrayEquals(f1.getCacheKey(), f3.getCacheKey()); Assert.assertArrayEquals(f1.getCacheKey(), f3.getCacheKey());