Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(assert): complete documentation #3900

Merged
merged 3 commits into from Dec 6, 2023
Merged

chore(assert): complete documentation #3900

merged 3 commits into from Dec 6, 2023

Conversation

iuioiua
Copy link
Collaborator

@iuioiua iuioiua commented Dec 6, 2023

Towards #3764 and #3878.

@github-actions github-actions bot added the assert label Dec 6, 2023
@iuioiua iuioiua marked this pull request as ready for review December 6, 2023 01:10
@iuioiua iuioiua requested a review from kt3k as a code owner December 6, 2023 01:10
Comment on lines -17 to -18
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16);
* assertThrows(() => assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are good examples for illustrating what tolerance is for. Let's keep them too

* Make an assertion that `actual` and `expected` are almost equal numbers
* through a given tolerance. It can be used to take into account IEEE-754
* double-precision floating-point representation limitations. If the values
* are not almost equal then throw.
*
* @example
* ```ts
* import { assertAlmostEquals, assertThrows } from "https://deno.land/std@$STD_VERSION/assert/mod.ts";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertThrows looks now unnecessary?

assert/assert_is_error.ts Outdated Show resolved Hide resolved
@kt3k
Copy link
Member

kt3k commented Dec 6, 2023

Mostly looks good. Left a few comments

iuioiua and others added 2 commits December 6, 2023 18:52
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
@iuioiua iuioiua requested a review from kt3k December 6, 2023 07:57
Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@iuioiua iuioiua merged commit 84a1373 into main Dec 6, 2023
12 checks passed
@iuioiua iuioiua deleted the assert-docs-2 branch December 6, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants