| 1044 | } |
| 1045 | |
| 1046 | func TestCollectOrTerms_MixedOrAndDisj(t *testing.T) { |
| 1047 | // collectOrTerms flattens OrNode{DisjunctionNode{A,B}, C}. |
| 1048 | a := cmp(prop("a"), "==", str("1")) |
| 1049 | b := cmp(prop("b"), "==", str("2")) |
| 1050 | c := cmp(prop("c"), "==", str("3")) |
| 1051 | terms := collectOrTerms(or2(disj(a, b), c)) |
| 1052 | require.Len(t, terms, 3, "should collect 3 terms from OrNode with DisjunctionNode child") |
| 1053 | } |
| 1054 | |
| 1055 | func TestCollectAndTerms_Flat(t *testing.T) { |
| 1056 | // collectAndTerms on a leaf returns just the leaf. |