Files
modeling-app/docs/kcl/assertEqual.md
Jess Frazelle be047f5111 add unit functions (#3604)
* 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>
2024-08-21 12:12:56 -07:00

26 KiB

title, excerpt, layout
title excerpt layout
assertEqual Check that a numerical value equals another at runtime, manual

Check that a numerical value equals another at runtime,

otherwise raise an error.

assertEqual(left: number, right: number, epsilon: number, message: string) -> ()

Examples

let n = 1.0285
let o = 1.0286
assertEqual(n, o, 0.01, "n is within the given tolerance for o")

Rendered example of assertEqual 0

Arguments

  • left: number (REQUIRED)
  • right: number (REQUIRED)
  • epsilon: number (REQUIRED)
  • message: string (REQUIRED)

Returns

()