I'm trying to understand followed-by-any
. Reading the docs, it seems like it allows a match, but also keeps that event available for other matches?
or is it more of a branching matcher?
i.e.
(-> (new-pattern-sequence "test")
(begin "matches-a" (fn [event & context] (= event "a")))
(followed-by-any "any" (constantly true)))
=> [["a" "b"] ["a" "c"] ["a" "d"]]
That's correct - it keeps it available for future matches.
Both things you said are correct - it's described as a branching primitive.
Highly recommend reading through Metamorphic's tests by the way.
There's tons of examples.