       (t/is (= x
                ((p/map-matcher [(X x)] x)
                 evt)))))
+  ;; FIXME: Docu below the same, tests different
   (t/testing "as constant with global defpattern"
     (let [x   "x"
           evt {"X" x}]


(t/deftest clause->lhs

  (t/testing "key exists"
    (t/is (= {:x 'x} (p/clause->lhs {} (p/key-exists-with-binding-clause :x "x"))))
    (t/is (= {:x 'rebind} (p/clause->lhs {} (p/key-exists-with-binding-clause :x "rebind")))))

  (t/testing "path exists"
    (t/is (= {:x {"b" {"c" 'c}}}
             (p/clause->lhs {} (p/path-exists-with-binding-clause [:x "b" "c"] "c"))))
    (t/is (= {:x {"b" {"c" 'rebind}}}
             (p/clause->lhs {} (p/path-exists-with-binding-clause [:x "b" "c"] "rebind")))))

  (t/testing "key matches"
    (t/is (= {:x "b"} (p/clause->lhs {} (p/key-matches-with-binding-clause :x (p/match-const "b") "x"))))
    (t/testing "lhs doesn't care abound bindings"
      (t/is (= {:x "b"} (p/clause->lhs {} (p/key-matches-with-binding-clause :x (p/match-const "b") "rebind")))))
    #_(t/is (= `({:x ~(quote _)} :guard [(constantly (~even? (get-in {} [:x])))])
             (p/clause->lhs {} (p/key-matches-with-binding-clause :x (p/match-predicate even?))))))

  (t/testing "path matches"
    (t/is (= {:x {:y {:z "b"}}} (p/clause->lhs {} (p/path-matches-with-binding-clause [:x :y :z] (p/match-const "b") "z"))))
    (t/is (= {:x {:y {:z "b"}}}
             (p/clause->lhs {} (-> (p/path-matches-with-binding-clause [:x :y :z] (p/match-const "b") "rebind")))))
    #_(t/is (= `({:x {:y {"Z" ~(quote _)}}} :guard [(constantly (~even? (get-in {} [:x :y "Z"])))])
             (p/clause->lhs {} (p/path-matches-with-binding-clause [:x :y "Z"] (p/match-predicate even?)))))))

(t/deftest path-matches-with-binding-clause->rhs-match-test
  (t/is (= `[~(symbol "z") (get-in {:x {:y {:z "b"}}} [:x :y :z] "b")]

                           [a c C Z])
            two-data))))

 ;; FIXME: map-matcher-or-test - #3 --- same test?
(t/deftest map-matcher-regex-key-not-found-test
  (t/is (= false
           (example-matcher three-data))))

