()
| 1085 | |
| 1086 | #[test] |
| 1087 | fn 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] |
| 1120 | fn test_dictionary_equal_null() { |
nothing calls this directly
no test coverage detected