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