[["i", ">=", 1]],
[["i", ">", 1]],
[["i", "includes", 1]],
- [["i", "excludes", 1]]]' \
+ [["i", "excludes", 1]],
+ [["i", ">", 0], ["i", "<", 2]]]' \
'[{"i": 0},
{"i": 1},
{"i": 2}']]],
condition 4: -TT
condition 5: --T
condition 6: -T-
-condition 7: T-T], [condition])
+condition 7: T-T
+condition 8: -T-], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on reals],
[[evaluate-conditions \
[["r", ">=", 5.0]],
[["r", ">", 5.0]],
[["r", "includes", 5.0]],
- [["r", "excludes", 5.0]]]' \
+ [["r", "excludes", 5.0]],
+ [["r", "!=", 0], ["r", "!=", 5.1]]]' \
'[{"r": 0},
{"r": 5.0},
{"r": 5.1}']]],
condition 4: -TT
condition 5: --T
condition 6: -T-
-condition 7: T-T], [condition])
+condition 7: T-T
+condition 8: -T-], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on booleans],
[[evaluate-conditions \
[["b", "==", false]],
[["b", "!=", false]],
[["b", "includes", false]],
- [["b", "excludes", false]]]' \
+ [["b", "excludes", false]],
+ [["b", "==", true], ["b", "==", false]]]' \
'[{"b": true},
{"b": false}']]],
[condition 0: T-
condition 4: -T
condition 5: T-
condition 6: -T
-condition 7: T-], [condition])
+condition 7: T-
+condition 8: --], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on strings],
[[evaluate-conditions \
[["s", "==", "foo"]],
[["s", "!=", "foo"]],
[["s", "includes", "foo"]],
- [["s", "excludes", "foo"]]]' \
+ [["s", "excludes", "foo"]],
+ [["s", "!=", "foo"], ["s", "!=", ""]]]' \
'[{"s": ""},
{"s": "foo"},
{"s": "xxx"}']]],
condition 4: -T-
condition 5: T-T
condition 6: -T-
-condition 7: T-T], [condition])
+condition 7: T-T
+condition 8: --T], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on UUIDs],
[[evaluate-conditions \
[["u", "==", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]],
[["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]],
[["u", "includes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]],
- [["u", "excludes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]]]' \
+ [["u", "excludes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]],
+ [["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]],
+ ["u", "!=", ["uuid", "cb160ed6-92a6-4503-a6aa-a09a09e01f0d"]]]]' \
'[{"u": ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]},
{"u": ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]},
{"u": ["uuid", "00000000-0000-0000-0000-000000000000"]}']]],
condition 4: -T-
condition 5: T-T
condition 6: -T-
-condition 7: T-T], [condition])
+condition 7: T-T
+condition 8: T-T], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on sets],
[[evaluate-conditions \
[["i", "excludes", ["set", [2]]]],
[["i", "excludes", ["set", [2, 0]]]],
[["i", "excludes", ["set", [2, 1]]]],
- [["i", "excludes", ["set", [2, 1, 0]]]]]' \
+ [["i", "excludes", ["set", [2, 1, 0]]]],
+ [["i", "includes", ["set", [0]]],
+ ["i", "includes", ["set", [1]]]]]' \
'[{"i": ["set", []]},
{"i": ["set", [0]]},
{"i": ["set", [1]]},
condition 28: TTTT- ---
condition 29: T-T-- ---
condition 30: TT--- ---
-condition 31: T---- ---], [condition])
+condition 31: T---- ---
+condition 32: ---T- --T], [condition])
# This is the same as the "set" test except that it adds values,
# all of which always match.
[["i", "excludes", ["map", [[2, true]]]]],
[["i", "excludes", ["map", [[2, true], [0, true]]]]],
[["i", "excludes", ["map", [[2, true], [1, false]]]]],
- [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]]]' \
+ [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]],
+ [["i", "includes", ["map", [[0, true]]]],
+ ["i", "includes", ["map", [[1, false]]]]]]' \
'[{"i": ["map", []]},
{"i": ["map", [[0, true]]]},
{"i": ["map", [[1, false]]]},
condition 28: TTTT- ---
condition 29: T-T-- ---
condition 30: TT--- ---
-condition 31: T---- ---], [condition])
+condition 31: T---- ---
+condition 32: ---T- --T], [condition])
# This is the same as the "set" test except that it adds values,
# and those values don't always match.
[["i", "excludes", ["map", [[2, true]]]]],
[["i", "excludes", ["map", [[2, true], [0, true]]]]],
[["i", "excludes", ["map", [[2, true], [1, false]]]]],
- [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]]]' \
+ [["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]],
+ [["i", "includes", ["map", [[0, true]]]],
+ ["i", "includes", ["map", [[1, false]]]]]]' \
'[{"i": ["map", []]},
{"i": ["map", [[0, true]]]},
{"i": ["map", [[0, false]]]},
condition 28: TTTTT TT-T- T----
condition 29: T-TTT ---T- -----
condition 30: TTT-T -T-T- T----
-condition 31: T-T-T ---T- -----], [condition])
+condition 31: T-T-T ---T- -----
+condition 32: ----- T---- ---T-], [condition])
+
+OVSDB_CHECK_POSITIVE([evaluating conditions on optional integers],
+ [[evaluate-conditions \
+ '{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": 1}}}}' \
+ '[[["i", "<", 1]],
+ [["i", "<=", 1]],
+ [["i", "==", 1]],
+ [["i", "!=", 1]],
+ [["i", ">=", 1]],
+ [["i", ">", 1]],
+ [["i", "includes", 1]],
+ [["i", "excludes", 1]],
+ [["i", ">", 0], ["i", "<", 2]]]' \
+ '[{"i": ["set", []]},
+ {"i": ["set", [0]]},
+ {"i": ["set", [1]]},
+ {"i": ["set", [2]]}]']],
+ [dnl
+condition 0: -T--
+condition 1: -TT-
+condition 2: --T-
+condition 3: TT-T
+condition 4: --TT
+condition 5: ---T
+condition 6: --T-
+condition 7: TT-T
+condition 8: --T-], [condition])
+
+OVSDB_CHECK_POSITIVE([evaluating conditions on optional strings],
+ [[evaluate-conditions \
+ '{"columns": {"s": {"type": {"key": "string", "min": 0, "max": 1}}}}' \
+ '[[["s", "==", ""]],
+ [["s", "!=", ""]],
+ [["s", "includes", ""]],
+ [["s", "excludes", ""]],
+ [["s", "==", "foo"]],
+ [["s", "!=", "foo"]],
+ [["s", "includes", "foo"]],
+ [["s", "excludes", "foo"]],
+ [["s", "!=", "foo"], ["s", "!=", ""]]]' \
+ '[{"s": ["set", [""]]},
+ {"s": ["set", ["foo"]]},
+ {"s": ["set", ["xxx"]]},
+ {"s": ["set", []]}]']],
+ [dnl
+condition 0: T---
+condition 1: -TTT
+condition 2: T---
+condition 3: -TTT
+condition 4: -T--
+condition 5: T-TT
+condition 6: -T--
+condition 7: T-TT
+condition 8: --TT], [condition])
+
+OVSDB_CHECK_POSITIVE([evaluating conditions on optional reals],
+ [[evaluate-conditions \
+ '{"columns": {"r": {"type": {"key": "real", "min": 0, "max": 1}}}}' \
+ '[[["r", "<", 5.0]],
+ [["r", "<=", 5.0]],
+ [["r", "==", 5.0]],
+ [["r", "!=", 5.0]],
+ [["r", ">=", 5.0]],
+ [["r", ">", 5.0]],
+ [["r", "includes", 5.0]],
+ [["r", "excludes", 5.0]],
+ [["r", "!=", 0], ["r", "!=", 5.1]]]' \
+ '[{"r": ["set", [0]]},
+ {"r": ["set", [5.0]]},
+ {"r": ["set", [5.1]]},
+ {"r": ["set", []]}]']],
+ [dnl
+condition 0: T---
+condition 1: TT--
+condition 2: -T--
+condition 3: T-TT
+condition 4: -TT-
+condition 5: --T-
+condition 6: -T--
+condition 7: T-TT
+condition 8: -T-T], [condition])