MCPcopy Create free account
hub / github.com/apache/arrow-rs / test_dictionary_equal

Function test_dictionary_equal

arrow/tests/array_equal.rs:1087–1117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1085
1086#[test]
1087fn test_dictionary_equal() {
1088 // (a, b, c), (1, 2, 1, 3) => (a, b, a, c)
1089 let a = create_dictionary_array(
1090 &["a", "b", "c"],
1091 &[Some("a"), Some("b"), Some("a"), Some("c")],
1092 );
1093 // different representation (values and keys are swapped), same result
1094 let b = create_dictionary_array(
1095 &["a", "c", "b"],
1096 &[Some("a"), Some("b"), Some("a"), Some("c")],
1097 );
1098 test_equal(&a, &b, true);
1099
1100 // different len
1101 let b = create_dictionary_array(&["a", "c", "b"], &[Some("a"), Some("b"), Some("a")]);
1102 test_equal(&a, &b, false);
1103
1104 // different key
1105 let b = create_dictionary_array(
1106 &["a", "c", "b"],
1107 &[Some("a"), Some("b"), Some("a"), Some("a")],
1108 );
1109 test_equal(&a, &b, false);
1110
1111 // different values, same keys
1112 let b = create_dictionary_array(
1113 &["a", "b", "d"],
1114 &[Some("a"), Some("b"), Some("a"), Some("d")],
1115 );
1116 test_equal(&a, &b, false);
1117}
1118
1119#[test]
1120fn test_dictionary_equal_null() {

Callers

nothing calls this directly

Calls 2

test_equalFunction · 0.85
create_dictionary_arrayFunction · 0.70

Tested by

no test coverage detected