unittest add resetOutputFormatters proc (#13267)
* add resetOutputFormatters * remove space * resolve comments
This commit is contained in:
parent
46bfb590c8
commit
84e8477b90
2 changed files with 6 additions and 1 deletions
|
|
@ -52,8 +52,8 @@
|
||||||
This simplifies code by reducing need for if-else branches around intermediate maybe nil values.
|
This simplifies code by reducing need for if-else branches around intermediate maybe nil values.
|
||||||
Eg: `echo ?.n.typ.kind`
|
Eg: `echo ?.n.typ.kind`
|
||||||
- Added `minIndex` and `maxIndex` to the `sequtils` module
|
- Added `minIndex` and `maxIndex` to the `sequtils` module
|
||||||
|
|
||||||
- Added `os.isRelativeTo` to tell whether a path is relative to another
|
- Added `os.isRelativeTo` to tell whether a path is relative to another
|
||||||
|
- Added `resetOutputFormatters` to `unittest`
|
||||||
|
|
||||||
## Library changes
|
## Library changes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,8 @@
|
||||||
import
|
import
|
||||||
macros, strutils, streams, times, sets, sequtils
|
macros, strutils, streams, times, sets, sequtils
|
||||||
|
|
||||||
|
include "system/inclrtl"
|
||||||
|
|
||||||
when declared(stdout):
|
when declared(stdout):
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
@ -186,6 +188,9 @@ proc delOutputFormatter*(formatter: OutputFormatter) =
|
||||||
keepIf(formatters, proc (x: OutputFormatter): bool =
|
keepIf(formatters, proc (x: OutputFormatter): bool =
|
||||||
x != formatter)
|
x != formatter)
|
||||||
|
|
||||||
|
proc resetOutputFormatters* {.since: (1, 1).} =
|
||||||
|
formatters = @[]
|
||||||
|
|
||||||
proc newConsoleOutputFormatter*(outputLevel: OutputLevel = OutputLevel.PRINT_ALL,
|
proc newConsoleOutputFormatter*(outputLevel: OutputLevel = OutputLevel.PRINT_ALL,
|
||||||
colorOutput = true): <//>ConsoleOutputFormatter =
|
colorOutput = true): <//>ConsoleOutputFormatter =
|
||||||
ConsoleOutputFormatter(
|
ConsoleOutputFormatter(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue