summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChris Heller <chrisheller@users.noreply.github.com>2019-09-03 00:14:19 -0700
committercooldome <cdome@bk.ru>2019-09-03 08:14:19 +0100
commit35f1519ad653284ce8778d066ebdeafc3ba8f17c (patch)
treea5be07c12d1784b9a2908b0277da3fc40da24453
parent79f1b8592a24e878fd886127708929d7fc613842 (diff)
downloadNim-35f1519ad653284ce8778d066ebdeafc3ba8f17c.tar.gz
Add delOutputFormatter proc to unittest.nim (#12032)
-rw-r--r--lib/pure/unittest.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pure/unittest.nim b/lib/pure/unittest.nim
index 3f84c1853..469e75c16 100644
--- a/lib/pure/unittest.nim
+++ b/lib/pure/unittest.nim
@@ -89,7 +89,7 @@
 ##     echo "suite teardown: run once after the tests"
 
 import
-  macros, strutils, streams, times, sets
+  macros, strutils, streams, times, sets, sequtils
 
 when declared(stdout):
   import os
@@ -176,6 +176,10 @@ method suiteEnded*(formatter: OutputFormatter) {.base, gcsafe.} =
 proc addOutputFormatter*(formatter: OutputFormatter) =
   formatters.add(formatter)
 
+proc delOutputFormatter*(formatter: OutputFormatter) =
+  keepIf(formatters, proc (x: OutputFormatter) : bool =
+    x != formatter)
+
 proc newConsoleOutputFormatter*(outputLevel: OutputLevel = PRINT_ALL,
                                 colorOutput = true): <//>ConsoleOutputFormatter =
   ConsoleOutputFormatter(