008 complex flow test

✓ Passing This code compiles and runs correctly.

Code

input.kz

Flows

subflow ~process-payment click a branch to expand · @labels scroll to their anchor
db.get-user (id: user_id)
flow ~test click a branch to expand · @labels scroll to their anchor
test (Successful payment, source: ~db.get-user => found { id: 42, balance: 100 } ~payment.charge => success "tx123" ~process-payment(user_id: 42, amount: 50) | success s |> assert(s.len == 5) // "tx123" has 5 chars)
flow ~test click a branch to expand · @labels scroll to their anchor
test (Insufficient funds rejected, source: ~db.get-user => found { id: 42, balance: 30 } ~process-payment(user_id: 42, amount: 50) | insufficient-funds |> assert.ok())
flow ~test click a branch to expand · @labels scroll to their anchor
test (User not found, source: ~db.get-user => not-found ~process-payment(user_id: 999, amount: 50) | user-not-found |> assert.ok())

Test Configuration

Post-validation Script: