Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
aokolnychyi committed Dec 6, 2023
1 parent ee9e1bf commit eefef22
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/src/test/java/org/apache/iceberg/util/TestStructLikeMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,14 @@ public void testKeysWithNulls() {
@Test
public void testEqualsAndHashCode() {
Map<StructLike, String> map1 = StructLikeMap.create(STRUCT_TYPE);
Map<StructLike, String> map2 = StructLikeMap.create(STRUCT_TYPE);

assertThat(map1).isEqualTo(map2);
assertThat(map1.hashCode()).isEqualTo(map2.hashCode());

map1.put(CustomRow.of(1, null), "aaa");
map1.put(CustomRow.of(2, null), "bbb");

Map<StructLike, String> map2 = StructLikeMap.create(STRUCT_TYPE);
map2.put(Row.of(1, null), "aaa");
map2.put(Row.of(2, null), "bbb");

Expand All @@ -167,10 +171,14 @@ public void testEqualsAndHashCode() {
@Test
public void testKeyAndEntrySetEquality() {
Map<StructLike, String> map1 = StructLikeMap.create(STRUCT_TYPE);
Map<StructLike, String> map2 = StructLikeMap.create(STRUCT_TYPE);

assertThat(map1.keySet()).isEqualTo(map2.keySet());
assertThat(map1.entrySet()).isEqualTo(map2.entrySet());

map1.put(CustomRow.of(1, null), "aaa");
map1.put(CustomRow.of(2, null), "bbb");

Map<StructLike, String> map2 = StructLikeMap.create(STRUCT_TYPE);
map2.put(Row.of(1, null), "aaa");
map2.put(Row.of(2, null), "bbb");

Expand Down

0 comments on commit eefef22

Please sign in to comment.