diff options
Diffstat (limited to 'std/fmt')
-rw-r--r-- | std/fmt/colors.ts | 4 | ||||
-rw-r--r-- | std/fmt/colors_test.ts | 6 | ||||
-rw-r--r-- | std/fmt/mod.ts | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/std/fmt/colors.ts b/std/fmt/colors.ts index 52ba22487..3f241d5b0 100644 --- a/std/fmt/colors.ts +++ b/std/fmt/colors.ts @@ -21,7 +21,7 @@ interface Code { let enabled = !noColor; -export function setEnabled(value: boolean): void { +export function setColorEnabled(value: boolean): void { if (noColor) { return; } @@ -29,7 +29,7 @@ export function setEnabled(value: boolean): void { enabled = value; } -export function getEnabled(): boolean { +export function getColorEnabled(): boolean { return enabled; } diff --git a/std/fmt/colors_test.ts b/std/fmt/colors_test.ts index 949bc34e7..467cda1bb 100644 --- a/std/fmt/colors_test.ts +++ b/std/fmt/colors_test.ts @@ -17,10 +17,10 @@ test(function replacesCloseCharacters(): void { }); test(function enablingColors(): void { - assertEquals(c.getEnabled(), true); - c.setEnabled(false); + assertEquals(c.getColorEnabled(), true); + c.setColorEnabled(false); assertEquals(c.bgBlue(c.red("foo bar")), "foo bar"); - c.setEnabled(true); + c.setColorEnabled(true); assertEquals(c.red("foo bar"), "[31mfoo bar[39m"); }); diff --git a/std/fmt/mod.ts b/std/fmt/mod.ts new file mode 100644 index 000000000..a0f8feb8b --- /dev/null +++ b/std/fmt/mod.ts @@ -0,0 +1,2 @@ +export * from "./colors.ts"; +export * from "./sprintf.ts"; |