From 9219d3e86eb8e46e01af5c00b02ec987b1184167 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Fri, 19 Dec 2025 09:20:50 -0600 Subject: [PATCH] Don't show sample highlighting for expected fields (which will never be highlighted). --- src/slfmt.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/slfmt.nim b/src/slfmt.nim index 155ed63..50cb81a 100644 --- a/src/slfmt.nim +++ b/src/slfmt.nim @@ -278,7 +278,10 @@ func formatExpectationLabels(expectations: seq[Expectation]): string = let label = alignLeft(exp.label, maxLabelLen) let count = alignLeft($exp.count, maxCountLen) - result = exp.termStyleCode & label & RESET_FORMATTING & " - " + if exp.expected: + result = label & " - " + else: + result = exp.termStyleCode & label & RESET_FORMATTING & " - " if (exp.expected and exp.count == 0) or (not exp.expected and exp.count > 0): @@ -296,7 +299,7 @@ proc parseLogLine(logLine: string): JsonNode = proc parseExpectations(args: Table[string, docopt.Value]): seq[Expectation] = result = @[] - for isExpected in [true, false]: + for isExpected in [false, true]: let argName = if isExpected: "--expected" else: "--unexpected" if args[argName]: let exptArgs = split($args[argName], ';')