Skip to content
Playground(another site)

bynk.expect.not_bool

Error expect was given a non-Bool predicate.

expect states a claim that is checked when the case runs, so its predicate must be a Bool: true, or the case fails. A count or a record is not a claim. Compare the value with what you expect (==, <, is), or use a method that returns Bool. It is the same predicate surface that invariant and ensures use.

Example

demo/count.bynk
fn bump(n: Int) -> Int { n + 1 }
// tests/count.test.bynk
expect bump(1) // ✗ an Int is not a claim
expect bump(1) == 2 // ✓ compare it

In the Book

See also

  • The grammar rule it governs: expect_expr.
  • Every code in its category, Expectations, on the diagnostic index.
  • bynk explain bynk.expect.not_bool shows the same from the installed toolchain, without a network.