* add unit functions Signed-off-by: Jess Frazelle <github@jessfraz.com> * add tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * update docs Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) * empty * A snapshot a day keeps the bugs away! 📷🐛 (OS: windows-latest) --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
38 lines
26 KiB
Markdown
38 lines
26 KiB
Markdown
---
|
|
title: "assertEqual"
|
|
excerpt: "Check that a numerical value equals another at runtime,"
|
|
layout: manual
|
|
---
|
|
|
|
Check that a numerical value equals another at runtime,
|
|
|
|
otherwise raise an error.
|
|
|
|
```js
|
|
assertEqual(left: number, right: number, epsilon: number, message: string) -> ()
|
|
```
|
|
|
|
### Examples
|
|
|
|
```js
|
|
let n = 1.0285
|
|
let o = 1.0286
|
|
assertEqual(n, o, 0.01, "n is within the given tolerance for o")
|
|
```
|
|
|
|

|
|
|
|
### Arguments
|
|
|
|
* `left`: `number` (REQUIRED)
|
|
* `right`: `number` (REQUIRED)
|
|
* `epsilon`: `number` (REQUIRED)
|
|
* `message`: `string` (REQUIRED)
|
|
|
|
### Returns
|
|
|
|
`()`
|
|
|
|
|
|
|