Fork me on GitHub
#onyx
<
2017-12-13
>
danielcompton00:12:58

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?

danielcompton00:12:30

or is it more of a branching matcher?

danielcompton00:12:59

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"]]

michaeldrogalis00:12:58

That's correct - it keeps it available for future matches.

michaeldrogalis00:12:11

Both things you said are correct - it's described as a branching primitive.

michaeldrogalis00:12:39

Highly recommend reading through Metamorphic's tests by the way.

michaeldrogalis00:12:45

There's tons of examples.