File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -213,24 +213,28 @@ defmodule ExUnit.CLIFormatter do
213
213
214
214
# Print styles
215
215
216
+ defp colorize ( escape , string ) do
217
+ IO.ANSI . escape_fragment ( "%{#{ escape } }" ) <> string <> IO.ANSI . escape_fragment ( "%{reset}" )
218
+ end
219
+
216
220
defp success ( msg ) do
217
- IO.ANSI . escape ( "%{ green}" <> msg )
221
+ colorize ( " green" , msg )
218
222
end
219
223
220
224
defp invalid ( msg ) do
221
- IO.ANSI . escape ( "%{ yellow}" <> msg )
225
+ colorize ( " yellow" , msg )
222
226
end
223
227
224
228
defp failure ( msg ) do
225
- IO.ANSI . escape ( "%{ red}" <> msg )
229
+ colorize ( " red" , msg )
226
230
end
227
231
228
232
defp error_info ( msg ) do
229
- IO.ANSI . escape ( "%{ red} " <> msg )
233
+ colorize ( " red" , " " <> msg )
230
234
end
231
235
232
236
defp location_info ( msg ) do
233
- IO.ANSI . escape ( "%{ cyan} " <> msg )
237
+ colorize ( " cyan" , " " <> msg )
234
238
end
235
239
236
240
defp stacktrace_info ( msg ) do
You can’t perform that action at this time.
0 commit comments