Standard Library
class ContractOperand
One reported operand of a violated predicate: its source text and its value.
since 0.1.0-alpha.1linuxwindowswasm
Examples
use io::console;
ContractOperand o = ContractOperand("cents", "-5");
console.writeln(o.text + " = " + o.value);
cents = -5
Constructors
new
new(string text, string value)Creates an operand record.
Parameters
- text
- The operand's source text.
- value
- The operand's formatted value.
Examples
use io::console;
ContractOperand o = ContractOperand("name", "\"bob\"");
console.writeln(o.value);
"bob"
Fields
text
string textThe operand as written in the predicate.
value
string valueThe operand's value, formatted: strings in double quotes, characters in single quotes.
See also
- ContractViolation — A violated contract: a failed
pre,post,assertorinvariant.