-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathFormatting.Literate.fs
407 lines (372 loc) · 23.6 KB
/
Formatting.Literate.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
module Logary.Tests.LiterateConsole
open System
open Expecto
open Expecto.Flip
open Hopac
open Hopac.Infixes
open Logary
open Logary.Tests
open Logary.Targets
open Logary.Targets.LiterateConsole
open Logary.Targets.LiterateConsole.Tokenisers
open Logary.Formatting
let tokenisation =
let failingFn (inner) =
raise (exn ("Top level exn", inner))
let throwAnotherExn inner =
try failingFn inner
with e -> e
let throwAggrExn inner1 inner2 =
try raise (AggregateException("Outer aggregate exception", inner1, inner2))
with e -> e
testList "tokenisation" [
testCase "tokenise hierarchal exn" <| fun _ ->
let exnInner = withException id
let exnOuter = throwAnotherExn exnInner
let expected =
[ "-", MessageTemplates.Formatting.Literate.Subtext // newline
"System.Exception: Top level exn", MessageTemplates.Formatting.Literate.Text
"Logary.Tests.LiterateConsole.throwAnotherExn@19(Exception inner)", MessageTemplates.Formatting.Literate.Subtext
"--- End of exception stack trace ---", MessageTemplates.Formatting.Literate.Punctuation
"System.Exception: Bad things going on", MessageTemplates.Formatting.Literate.Text
"Logary.Tests.Utils.innermost[a](Boolean throwCLRExn)", MessageTemplates.Formatting.Literate.Subtext
]
Message.event Warn "General error" |> Message.addExn exnOuter
|> Literate.tokeniseExceptions Culture.invariant "-"
|> Expect.sequenceContainsOrder "Has correct output" expected
testCase "tokenise Aggregate exn" <| fun _ ->
let e1, e2 = withException id, withException id
let exnOuter = throwAggrExn e1 e2
let expected =
[ "-", MessageTemplates.Formatting.Literate.Subtext // newline
"System.AggregateException: Outer aggregate exception (Bad things going on) (Bad things going on)", MessageTemplates.Formatting.Literate.Text
"Logary.Tests.LiterateConsole.throwAggrExn@23(Exception inner1, Exception inner2)", MessageTemplates.Formatting.Literate.Subtext
"--- End of exception stack trace ---", MessageTemplates.Formatting.Literate.Punctuation
"System.Exception: Bad things going on", MessageTemplates.Formatting.Literate.Text
"Logary.Tests.Utils.innermost[a](Boolean throwCLRExn)", MessageTemplates.Formatting.Literate.Subtext
"--- End of exception stack trace ---", MessageTemplates.Formatting.Literate.Punctuation
"System.Exception: Bad things going on", MessageTemplates.Formatting.Literate.Text
"Logary.Tests.Utils.innermost[a](Boolean throwCLRExn)", MessageTemplates.Formatting.Literate.Subtext
]
Message.event Warn "My error" |> Message.addExn exnOuter
|> Literate.tokeniseExceptions Culture.invariant "-"
|> Expect.sequenceContainsOrder "Has correct output" expected
]
module LiterateTesting =
module Theme =
let textColours = { foreground=ConsoleColor.White; background=None }
let subtextColours = { foreground=ConsoleColor.Gray; background=None }
let punctuationColours = { foreground=ConsoleColor.DarkGray; background=None }
let levelVerboseColours = { foreground=ConsoleColor.Gray; background=None }
let levelDebugColours = { foreground=ConsoleColor.Gray; background=None }
let levelInfoColours = { foreground=ConsoleColor.White; background=None }
let levelWarningColours = { foreground=ConsoleColor.Yellow; background=None }
let levelErrorColours = { foreground=ConsoleColor.White; background=Some ConsoleColor.Red }
let levelFatalColours = { foreground=ConsoleColor.White; background=Some ConsoleColor.Red }
let keywordSymbolColours = { foreground=ConsoleColor.Blue; background=None }
let numericSymbolColours = { foreground=ConsoleColor.Magenta; background=None }
let stringSymbolColours = { foreground=ConsoleColor.Cyan; background=None }
let otherSymbolColours = { foreground=ConsoleColor.Green; background=None }
let nameSymbolColours = { foreground=ConsoleColor.Gray; background=None }
let missingTemplateFieldColours = { foreground=ConsoleColor.Red; background=None }
let theme = function
| Tokens.Text -> textColours
| Tokens.Subtext -> subtextColours
| Tokens.Punctuation -> punctuationColours
| Tokens.LevelVerbose -> levelVerboseColours
| Tokens.LevelDebug -> levelDebugColours
| Tokens.LevelInfo -> levelInfoColours
| Tokens.LevelWarning -> levelWarningColours
| Tokens.LevelError -> levelErrorColours
| Tokens.LevelFatal -> levelFatalColours
| Tokens.KeywordSymbol -> keywordSymbolColours
| Tokens.NumericSymbol -> numericSymbolColours
| Tokens.StringSymbol -> stringSymbolColours
| Tokens.OtherSymbol -> otherSymbolColours
| Tokens.NameSymbol -> nameSymbolColours
| Tokens.MissingTemplateField -> missingTemplateFieldColours
let levelD, levelE, levelF, levelI, levelV, levelW = "D", "E", "F", "I", "V", "W"
let singleLetterLogLevelText = function
| Debug -> levelD
| Error -> levelE
| Fatal -> levelF
| Info -> levelI
| Verbose -> levelV
| Warn -> levelW
let frenchFormatProvider = System.Globalization.CultureInfo("fr-FR") :> IFormatProvider
let formatLocalTime provider (ens: EpochNanoSeconds) =
let dto = DateTimeOffset.ofEpoch ens
dto.LocalDateTime.ToString("HH:mm:ss", provider),
Tokens.Subtext
/// creates a LiterateConsoleConf for testing purposes, and also returns a function that,
/// when invoked, returns the coloured text parts written to the target.
let createInspectableWrittenPartsConf (tokeniserSubject) =
let writtenParts = ResizeArray<LiterateConsole.ColouredText>()
// replace everything except for tokenize
{ LiterateConsole.empty with
tokenise = tokeniserSubject
formatProvider = frenchFormatProvider
getLogLevelText = singleLetterLogLevelText
formatLocalTime = formatLocalTime
theme = Theme.theme
colourWriter = fun sem parts -> writtenParts.AddRange(parts) },
fun () -> writtenParts |> List.ofSeq
/// 5 values
let levels expectedTimeText: LiterateConsole.ColouredText list =
[ { text = "["; colours = LiterateTesting.Theme.punctuationColours }
{ text = expectedTimeText; colours = LiterateTesting.Theme.subtextColours }
{ text = " "; colours = LiterateTesting.Theme.subtextColours }
{ text = LiterateTesting.levelI; colours = LiterateTesting.Theme.levelInfoColours }
{ text = "] "; colours = LiterateTesting.Theme.punctuationColours } ]
let parts =
testList "parts" [
yield testCase "formatLocalTime" <| fun _ ->
let actual, _ =
let fp: IFormatProvider = upcast CultureInfo "sv-SE"
LiterateConsole.empty.formatLocalTime
fp (DateTimeOffset(2016, 10, 25, 11, 17, 41, TimeSpan(2,0,0)).asTimestamp)
let expected = "13:17:41"
Expect.isTrue (Regex.IsMatch(actual, @"\d{2}:\d{2}:\d{2}"))
(sprintf "Should print the time without time zone, was: %s" actual)
let testLiterateCase testMsg messageFactory tokeniser cb =
let conf, getWrittenParts = LiterateTesting.createInspectableWrittenPartsConf tokeniser
let message = messageFactory Info
testCaseJob testMsg (job {
// in context
let! ri = emptyRuntime
let! targetApi = LiterateConsole.create conf "testLC" |> Target.create ri
// because
do! logMsgWaitAndShutdown targetApi (fun logAndWait ->
logAndWait message >>- fun _ ->
let written, expectedTimeText =
getWrittenParts (),
fst (LiterateTesting.formatLocalTime conf.formatProvider message.timestamp)
cb expectedTimeText written)
})
yield testLiterateCase "printing 'Hello World!'" helloWorld defaultTokeniser <| fun timeText parts ->
let expected =
[ yield! levels timeText
yield { text = "Hello World!"; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "<"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = ""; colours = LiterateTesting.Theme.subtextColours }
yield { text = ">"; colours = LiterateTesting.Theme.punctuationColours }
]
parts
|> Expect.formattedEqual
"Should print the right output text"
(sprintf "[%s I] Hello World! <>" timeText)
parts
|> Expect.sequenceEqual "Should log with info level" expected
let gaugeFirstLine =
[ yield { text = "Gauges: "; colours = LiterateTesting.Theme.textColours }
yield { text = "["; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "Check"; colours = LiterateTesting.Theme.nameSymbolColours }
yield { text = " took "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "60,03"; colours = LiterateTesting.Theme.numericSymbolColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "ms"; colours = LiterateTesting.Theme.textColours }
yield { text = " to execute"; colours = LiterateTesting.Theme.subtextColours }
yield { text = "]"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "<"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "A.B.C"; colours = LiterateTesting.Theme.subtextColours }
yield { text = ">"; colours = LiterateTesting.Theme.punctuationColours }
]
let g = timeMessage 60029379L
yield testLiterateCase "Time in ms" g defaultTokeniser <| fun timeText parts ->
let expected =
[ yield! levels timeText
yield! gaugeFirstLine ]
parts
|> Expect.formattedEqual
"Should print the right output text"
(sprintf "[%s I] Gauges: [Check took 60,03 ms to execute] <A.B.C>" timeText)
parts
|> Expect.sequenceEqual "Should print [06:15:02 INF] A.B.C.Check took 60,02 ms" expected
yield testLiterateCase "Time in ms (ext)" g extendedTokeniser <| fun timeText parts ->
let expected =
[ yield! levels timeText
yield! gaugeFirstLine
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " gauges:"; colours = LiterateTesting.Theme.textColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "Check"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"60.029379 ms\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " others:"; colours = LiterateTesting.Theme.textColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "_logary.tags"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "["; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"gauge\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = "]"; colours = LiterateTesting.Theme.punctuationColours }
]
parts
|> Expect.sequenceEqual "Should print [06:15:02 INF] A.B.C.Check took 60,02 ms" expected
yield testLiterateCase "Time in μs" (timeMessage 133379L) defaultTokeniser <| fun expectedTimeText parts ->
let expected =
[ yield! levels expectedTimeText
yield { text = "Gauges: "; colours = LiterateTesting.Theme.textColours }
yield { text = "["; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "Check"; colours = LiterateTesting.Theme.nameSymbolColours }
yield { text = " took "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "133,38"; colours = LiterateTesting.Theme.numericSymbolColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "µs"; colours = LiterateTesting.Theme.textColours }
yield { text = " to execute"; colours = LiterateTesting.Theme.subtextColours }
yield { text = "]"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "<"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "A.B.C"; colours = LiterateTesting.Theme.subtextColours }
yield { text = ">"; colours = LiterateTesting.Theme.punctuationColours }
]
parts
|> Expect.sequenceEqual "Should print [06:15:02 INF] A.B.C.Perform took 133,38 μs" expected
yield testLiterateCase "Time in ns" (timeMessage 139L) defaultTokeniser <| fun expectedTimeText parts ->
let expected =
[ yield! levels expectedTimeText
yield { text = "Gauges: "; colours = LiterateTesting.Theme.textColours }
yield { text = "["; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "Check"; colours = LiterateTesting.Theme.nameSymbolColours }
yield { text = " took "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "139"; colours = LiterateTesting.Theme.numericSymbolColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "ns"; colours = LiterateTesting.Theme.textColours }
yield { text = " to execute"; colours = LiterateTesting.Theme.subtextColours }
yield { text = "]"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "<"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "A.B.C"; colours = LiterateTesting.Theme.subtextColours }
yield { text = ">"; colours = LiterateTesting.Theme.punctuationColours }
]
parts
|> Expect.sequenceEqual "Should print [06:15:02 INF] Check took 139 μs, because nanoseconds is as accurate as it gets" expected
let g = gaugeMessage 1.4562
let singleM =
[ yield { text = "Gauges: "; colours = LiterateTesting.Theme.textColours }
yield { text = "["; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "spin"; colours = LiterateTesting.Theme.nameSymbolColours }
yield { text = ":"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "1,4562"; colours = LiterateTesting.Theme.numericSymbolColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "s/revolution"; colours = LiterateTesting.Theme.textColours }
yield { text = "]"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "<"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "Revolver"; colours = LiterateTesting.Theme.subtextColours }
yield { text = ">"; colours = LiterateTesting.Theme.punctuationColours }
]
yield testLiterateCase "single measurement per second gauge" g defaultTokeniser <| fun timeText parts ->
let expected =
[ yield! levels timeText
yield! singleM ]
parts
|> Expect.formattedEqual
"Should print the right output text"
(sprintf "[%s I] Gauges: [spin: 1,4562 s/revolution] <Revolver>" timeText)
parts
|> Expect.sequenceEqual "Prints the tokens in the right order" expected
yield testLiterateCase "single measurement per second gauge (ext)" g extendedTokeniser <| fun timeText parts ->
let expected =
[ yield! levels timeText
yield! singleM
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " gauges:"; colours = LiterateTesting.Theme.textColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "spin"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"1.4562 s/revolution\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " others:"; colours = LiterateTesting.Theme.textColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "_logary.tags"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "["; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"gauge\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = "]"; colours = LiterateTesting.Theme.punctuationColours }
]
parts
|> Expect.sequenceEqual "Should print '[06:15:02 INF] Gauges: [spin: 1,4562 s/revolution] <Revolver>'" expected
yield testLiterateCase "Multiple measurements per second gauge" multiGaugeMessage extendedTokeniser <| fun timeText parts ->
//LiterateConsole.empty.colourWriter (Global.getConsoleSemaphore ()) (upcast parts)
//printfn "Parts: %s" (parts |> List.map (fun ct -> ct.text) |> String.Concat)
let expected =
[ yield! levels timeText
yield { text = "Processor.% Idle"; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "Gauges: "; colours = LiterateTesting.Theme.textColours }
yield { text = "["; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "Core 1"; colours = LiterateTesting.Theme.nameSymbolColours }
yield { text = ":"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "0,1"; colours = LiterateTesting.Theme.numericSymbolColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "%"; colours = LiterateTesting.Theme.textColours }
yield { text = ", "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "Core 2"; colours = LiterateTesting.Theme.nameSymbolColours }
yield { text = ":"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "99"; colours = LiterateTesting.Theme.numericSymbolColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "%"; colours = LiterateTesting.Theme.textColours }
yield { text = ", "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "Core 3"; colours = LiterateTesting.Theme.nameSymbolColours }
yield { text = ":"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "47,3223755"; colours = LiterateTesting.Theme.numericSymbolColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "%"; colours = LiterateTesting.Theme.textColours }
yield { text = "]"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = " "; colours = LiterateTesting.Theme.subtextColours }
yield { text = "<"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = ""; colours = LiterateTesting.Theme.subtextColours }
yield { text = ">"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " gauges:"; colours = LiterateTesting.Theme.textColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "Core 1"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"0.1 %\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "Core 2"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"99 %\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "Core 3"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"47.3223755 %\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " others:"; colours = LiterateTesting.Theme.textColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "_logary.tags"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "["; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"gauge\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = "]"; colours = LiterateTesting.Theme.punctuationColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "host"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"db-001\""; colours = LiterateTesting.Theme.stringSymbolColours }
yield { text = Environment.NewLine; colours = LiterateTesting.Theme.textColours }
yield { text = " "; colours = LiterateTesting.Theme.textColours }
yield { text = "service"; colours = LiterateTesting.Theme.subtextColours }
yield { text = " => "; colours = LiterateTesting.Theme.punctuationColours }
yield { text = "\"api-web\""; colours = LiterateTesting.Theme.stringSymbolColours }
]
parts
|> Expect.sequenceEqual
"Should print [06:15:02 INF] Processor.% Idle Gauges: [Core 1: 0,10 %, Core 2: 99,00 %, Core 3: 47,32 %"
expected
]