op = T_OP_CMP_EQ;
}
+ /*
+ * Both lists are empty, they should be equal when checked for equality.
+ */
+ if ((fr_value_box_list_num_elements(list1) == 0) &&
+ (fr_value_box_list_num_elements(list2) == 0)) {
+ switch (op) {
+ case T_OP_CMP_EQ:
+ case T_OP_LE:
+ case T_OP_GE:
+ invert = !invert;
+ break;
+
+ default:
+ break;
+ }
+
+ goto done;
+ }
+
/*
* Emulate v3. :(
*/
}
/*
- * No match.
+ * No match,
*/
+done:
fr_value_box_clear(dst);
fr_value_box_init(dst, FR_TYPE_BOOL, NULL, false); // @todo - add enum!
dst->vb_bool = invert;
--- /dev/null
+#
+# Test empty lists, or xlat failures.
+#
+# {} == {} --> true
+#
+if !(%test.fail() == %test.fail()) {
+ test_fail
+}
+
+#
+# {} != {} --> false
+#
+if (%test.fail() != %test.fail()) {
+ test_fail
+}
+
+#
+# {} <= {} --> true
+#
+if !(%test.fail() <= %test.fail()) {
+ test_fail
+}
+
+#
+# {} < {} --> false
+#
+if (%test.fail() < %test.fail()) {
+ test_fail
+}
+
+#
+# {} >= {} --> true
+#
+if !(%test.fail() >= %test.fail()) {
+ test_fail
+}
+
+#
+# {} > {} --> false
+#
+if (%test.fail() > %test.fail()) {
+ test_fail
+}
+
+success