mirror of
https://github.com/amyjko/cooperative-software-development
synced 2024-12-26 21:58:27 +01:00
Removed extra backtick.
This commit is contained in:
parent
f5eeaac3e7
commit
e27c9d8ffc
1 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ Of course, if the above was JavaScript code (which doesn't support static typing
|
|||
|
||||
This brings us to a second purpose of writing functional specifications: to help _verify_ that functions, their input, and their output are correct. Tests of functions and other low-level procedures are called *unit tests*. There are many ways to use specifications to verify correctness. By far, one of the simplest and most widely used kinds of unit tests are *assertions*<clarke06>. Assertions consist of two things: 1) a check on some property of a function's input or output and 2) some action to notify about violations of these properties. For example, if we wanted to verify that the JavaScript function above had integer values as inputs, we would do this:
|
||||
|
||||
``javascript
|
||||
`javascript
|
||||
// Return the smaller of the two numbers, or if they're equal, the second number.
|
||||
function min(a, b) {
|
||||
if(!Number.isInteger(a))
|
||||
|
|
Loading…
Reference in a new issue