Skip to content
Playground(another site)

bynk.test.wire_needs_system

Error A Wire(...) raw argument is used outside a system-tier service address; Wire hands pre-validation input to the boundary and is meaningless at unit or in any other position.

Wire(…) hands raw text to the real boundary, before any decoding, so that a case can check what the boundary refuses. Only a system case has a real boundary: below it the handler is called directly, and the text would go in unchecked. Promote the case with as system, or pass a typed value instead. For other addresses, see bynk.test.wire_http_only.

Example

tests/api.test.bynk
case "raw text is refused" { // ✗ not a system case
case "raw text is refused" as system { // ✓
let r <- api.POST("/n", Wire("0")) by Visitor
expect r is Rejected(RefinementViolation(_))
}

In the Book

See also

  • The grammar rule it governs: case.
  • Every code in its category, Tests, on the diagnostic index.
  • bynk explain bynk.test.wire_needs_system shows the same from the installed toolchain, without a network.