unittest add resetOutputFormatters proc (#13267)

* add resetOutputFormatters

* remove space

* resolve comments
This commit is contained in:
cooldome 2020-01-28 14:16:03 +00:00 • committed by GitHub
commit 84e8477b90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -96,6 +96,8 @@
import
macros, strutils, streams, times, sets, sequtils
include "system/inclrtl"
when declared(stdout):
import os
@ -186,6 +188,9 @@ proc delOutputFormatter*(formatter: OutputFormatter) =
keepIf(formatters, proc (x: OutputFormatter): bool =
x != formatter)
proc resetOutputFormatters* {.since: (1, 1).} =
formatters = @[]
proc newConsoleOutputFormatter*(outputLevel: OutputLevel = OutputLevel.PRINT_ALL,
colorOutput = true): <//>ConsoleOutputFormatter =
ConsoleOutputFormatter(