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

Function test_dictionary_equal_null

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

Source from the content-addressed store, hash-verified

1118
1119#[test]
1120fn test_dictionary_equal_null() {
1121 // (a, b, c), (1, 2, 1, 3) => (a, b, a, c)
1122 let a = create_dictionary_array(&["a", "b", "c"], &[Some("a"), None, Some("a"), Some("c")]);
1123
1124 // equal to self
1125 test_equal(&a, &a, true);
1126
1127 // different representation (values and keys are swapped), same result
1128 let b = create_dictionary_array(&["a", "c", "b"], &[Some("a"), None, Some("a"), Some("c")]);
1129 test_equal(&a, &b, true);
1130
1131 // different null position
1132 let b = create_dictionary_array(&["a", "c", "b"], &[Some("a"), Some("b"), Some("a"), None]);
1133 test_equal(&a, &b, false);
1134
1135 // different key
1136 let b = create_dictionary_array(&["a", "c", "b"], &[Some("a"), None, Some("a"), Some("a")]);
1137 test_equal(&a, &b, false);
1138
1139 // different values, same keys
1140 let b = create_dictionary_array(&["a", "b", "d"], &[Some("a"), None, Some("a"), Some("d")]);
1141 test_equal(&a, &b, false);
1142}
1143
1144#[test]
1145fn test_non_null_empty_strings() {

Callers

nothing calls this directly

Calls 2

test_equalFunction · 0.85
create_dictionary_arrayFunction · 0.70

Tested by

no test coverage detected