Skip to content

Commit ef5ba26

Browse files
authored
Merge pull request #1404 from divyaranjan1905/master
fix: reduce html class names to their first letters
2 parents d965855 + 4eafbcc commit ef5ba26

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/Echidna/Output/Source.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ ppCoveredCode fileType sc cs s | null s = "Coverage map is empty"
8585
topHeader = case fileType of
8686
Lcov -> "TN:\n"
8787
Html -> "<style> code { white-space: pre-wrap; display: block; background-color: #eee; }" <>
88-
".executed { background-color: #afa; }" <>
89-
".reverted { background-color: #ffa; }" <>
90-
".unexecuted { background-color: #faa; }" <>
91-
".neutral { background-color: #eee; }" <>
88+
".e { background-color: #afa; }" <> -- executed
89+
".r { background-color: #ffa; }" <> -- reverted
90+
".u { background-color: #faa; }" <> -- unexecuted
91+
".n { background-color: #eee; }" <> -- neutral
9292
"</style>"
9393
Txt -> ""
9494
-- ^ Text to add to top of the file
@@ -123,7 +123,7 @@ markLines fileType codeLines runtimeLines resultMap =
123123
"</span>"
124124
_ -> line
125125
where
126-
cssClass = if n `elem` runtimeLines then getCSSClass markers else "neutral"
126+
cssClass = if n `elem` runtimeLines then getCSSClass markers else "n" -- fallback to 'neutral' class.
127127
result = case fileType of
128128
Lcov -> pack $ printf "DA:%d,%d" n (length results)
129129
_ -> pack $ printf " %*d | %-4s| %s" lineNrSpan n markers (wrapLine codeLine)
@@ -134,9 +134,9 @@ markLines fileType codeLines runtimeLines resultMap =
134134
getCSSClass :: String -> Text
135135
getCSSClass markers =
136136
case markers of
137-
[] -> "unexecuted"
138-
_ | '*' `elem` markers -> "executed"
139-
_ -> "reverted"
137+
[] -> "u" -- unexecuted
138+
_ | '*' `elem` markers -> "e" -- executed
139+
_ -> "r" -- reverted
140140

141141
-- | Select the proper marker, according to the result of the transaction
142142
getMarker :: TxResult -> Char

0 commit comments

Comments
 (0)