2024-09-19 05:38:32 +00:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
|
|
|
import { assertEquals } from "@std/assert";
|
|
|
|
import { AssertionState } from "./assertion_state.ts";
|
|
|
|
|
2024-10-25 08:29:40 +00:00
|
|
|
Deno.test("AssertionState checkAssertionErrorState pass", () => {
|
2024-09-19 05:38:32 +00:00
|
|
|
const assertionState = new AssertionState();
|
|
|
|
assertionState.setAssertionTriggered(true);
|
|
|
|
|
2024-10-25 08:29:40 +00:00
|
|
|
assertEquals(assertionState.checkAssertionErrorState(), false);
|
2024-09-19 05:38:32 +00:00
|
|
|
});
|
|
|
|
|
2024-10-25 08:29:40 +00:00
|
|
|
Deno.test("AssertionState checkAssertionErrorState pass", () => {
|
2024-09-19 05:38:32 +00:00
|
|
|
const assertionState = new AssertionState();
|
|
|
|
assertionState.setAssertionTriggered(true);
|
|
|
|
|
2024-10-25 08:29:40 +00:00
|
|
|
assertEquals(assertionState.checkAssertionErrorState(), false);
|
2024-09-19 05:38:32 +00:00
|
|
|
|
|
|
|
assertionState.setAssertionCheck(true);
|
2024-10-25 08:29:40 +00:00
|
|
|
assertEquals(assertionState.checkAssertionErrorState(), false);
|
2024-09-19 05:38:32 +00:00
|
|
|
});
|
|
|
|
|
2024-10-25 08:29:40 +00:00
|
|
|
Deno.test("AssertionState checkAssertionErrorState fail", () => {
|
2024-09-19 05:38:32 +00:00
|
|
|
const assertionState = new AssertionState();
|
|
|
|
assertionState.setAssertionCheck(true);
|
|
|
|
|
2024-10-25 08:29:40 +00:00
|
|
|
assertEquals(assertionState.checkAssertionErrorState(), true);
|
2024-09-19 05:38:32 +00:00
|
|
|
});
|