mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
6a4eb6cb91
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import { assertEquals } from "@std/assert";
|
|
import { AssertionState } from "./assertion_state.ts";
|
|
|
|
Deno.test("AssertionState checkAssertionErrorStateAndReset pass", () => {
|
|
const assertionState = new AssertionState();
|
|
assertionState.setAssertionTriggered(true);
|
|
|
|
assertEquals(assertionState.checkAssertionErrorStateAndReset(), false);
|
|
});
|
|
|
|
Deno.test("AssertionState checkAssertionErrorStateAndReset pass", () => {
|
|
const assertionState = new AssertionState();
|
|
assertionState.setAssertionTriggered(true);
|
|
|
|
assertEquals(assertionState.checkAssertionErrorStateAndReset(), false);
|
|
|
|
assertionState.setAssertionCheck(true);
|
|
assertEquals(assertionState.checkAssertionErrorStateAndReset(), true);
|
|
});
|
|
|
|
Deno.test("AssertionState checkAssertionErrorStateAndReset fail", () => {
|
|
const assertionState = new AssertionState();
|
|
assertionState.setAssertionCheck(true);
|
|
|
|
assertEquals(assertionState.checkAssertionErrorStateAndReset(), true);
|
|
});
|