-
Notifications
You must be signed in to change notification settings - Fork 1
Conventions
Shane Kelly edited this page Aug 27, 2017
·
26 revisions
https://github.com/erlang/otp/wiki/writing-good-commit-messages
We have created a standard function that checks to make sure a given statement is true and, if not, throws an error with a specified message.
All assert messages should state the current state of things if an error is thrown and should in almost all cases include the word not
.
If a variable x
must be greater than or equal to variable y
:
assert(x >= y, 'x is less than y');
If a variable x
must be even:
assert(x % 2 === 0, 'x is not even');
Note that in this example, the assert does not say x is odd
.