File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 22
22
** evaluate to a boolean.
23
23
**
24
24
** As well as the condition they have a text argument that should be
25
- ** used to say why they are true. The reason should be a string literals.
25
+ ** used to say why they are true. The reason should be a string literals
26
+ ** starting with a lower case character.
26
27
** Longer diagnostics should be output to error(). For example:
27
28
**
28
- ** INVARIANT(x > 0, "x negative and zero case handled by other branches");
29
+ ** INVARIANT(
30
+ ** x > 0,
31
+ ** "x should have a positive value as others are handled by other branches");
32
+ **
33
+ ** Use "should" style statements for messages in invariants (e.g. "array
34
+ ** should have a non-zero size") to make both the violation and the
35
+ ** expected behavior clear. (As opposed to "no zero size arrays" where it
36
+ ** isn't clear if the zero-size array is the problem, or the lack of it).
29
37
**
30
38
** To help classify different kinds of invariants, various short-hand
31
39
** macros are provided.
You can’t perform that action at this time.
0 commit comments