// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import { test } from "../testing/mod.ts"; import { assertEq } from "../testing/asserts.ts"; import { red, bgBlue, setEnabled, getEnabled } from "./mod.ts"; import "./example.ts"; test(function singleColor() { assertEq(red("Hello world"), "Hello world"); }); test(function doubleColor() { assertEq(bgBlue(red("Hello world")), "Hello world"); }); test(function replacesCloseCharacters() { assertEq(red("Hello"), "Hello"); }); test(function enablingColors() { assertEq(getEnabled(), true); setEnabled(false); assertEq(bgBlue(red("Hello world")), "Hello world"); setEnabled(true); assertEq(red("Hello world"), "Hello world"); });