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