Assertions in design by contract: Difference between revisions

m
m (→‎{{header|Wren}}: Minor tidy)
 
(2 intermediate revisions by one other user not shown)
Line 345:
 
=={{header|jq}}==
{{libheader|Jq/assert.jq}}
Uses: https://rosettacode.org/wiki/Category:jq-assert
{{works with|jq}}
 
Line 357:
In the following, it is assumed the "debug" mode of assertion checking has been used, e.g.
via the invocation: jq --arg assert debug
 
This mode allows execution to continue after an assertion violation has been detected.
<syntaxhighlight lang="jq">
include "rc-assert" {search: "."}; # or use the -L command-line option
Line 825 ⟶ 827:
{{libheader|Wren-assert}}
Wren doesn't support assertions natively though they (and design by contract) can be simulated using a library.
<syntaxhighlight lang="ecmascriptwren">import "./assert" for Assert
import "./math" for Nums
 
// Assert.disabled = true
9,483

edits