|
6 | 6 | [state-flow.assertions.matcher-combinators :as mc] |
7 | 7 | [state-flow.core :as state-flow :refer [flow]] |
8 | 8 | [state-flow.state :as state] |
9 | | - [state-flow.test-helpers :as test-helpers :refer [this-line-number shhh!]])) |
| 9 | + [state-flow.test-helpers :as test-helpers :refer [shhh! this-line-number]])) |
10 | 10 |
|
11 | 11 | (def get-value-state (state/gets (comp deref :value))) |
12 | 12 |
|
|
39 | 39 | (let [[flow-ret flow-state] |
40 | 40 | (state/run |
41 | 41 | (flow "flow" |
42 | | - (test-helpers/swap-later 100 :value + 2) |
43 | | - (mc/match? 2 (state/gets (comp deref :value)) {:times-to-try 3 |
44 | | - :sleep-time 110})) |
| 42 | + (test-helpers/swap-later 100 :value + 2) |
| 43 | + (mc/match? 2 (state/gets (comp deref :value)) {:times-to-try 3 |
| 44 | + :sleep-time 110})) |
45 | 45 | {:value (atom 0)})] |
46 | 46 | (testing "returns match result with probe info" |
47 | 47 | (is (match? {:probe/sleep-time 110 |
|
89 | 89 | (let [[flow-ret flow-state] |
90 | 90 | (state-flow/run |
91 | 91 | (flow "flow" |
92 | | - (test-helpers/swap-later 200 :count + 2) |
93 | | - (testing "2" (mc/match? 2 |
94 | | - (state/gets (comp deref :count)) |
95 | | - {:times-to-try 2 |
96 | | - :sleep-time 75}))) |
| 92 | + (test-helpers/swap-later 200 :count + 2) |
| 93 | + (testing "2" (mc/match? 2 |
| 94 | + (state/gets (comp deref :count)) |
| 95 | + {:times-to-try 2 |
| 96 | + :sleep-time 75}))) |
97 | 97 | {:count (atom 0)})] |
98 | 98 | (testing "returns match result" |
99 | 99 | (is (match? {:match/result :mismatch} flow-ret))) |
|
126 | 126 | :fail-fast? true |
127 | 127 | :on-error state-flow/ignore-error} |
128 | 128 | (flow "stop before boom" |
129 | | - (mc/match? 1 2) |
130 | | - (flow "will explode" bogus))))] |
| 129 | + (mc/match? 1 2) |
| 130 | + (flow "will explode" bogus))))] |
131 | 131 | (testing "state is left as is" |
132 | 132 | (is (match? {:value 0} (second result)))) |
133 | 133 | (testing "the return value is the same as a failing match?" |
|
0 commit comments