Closed afbjorklund closed 11 months ago
Having shared parameter for icon formats sounds good to me
Maybe color needs a separate function and separate controls too?
Currently it is hardcoded "on" and "off", for the different icons.
Probably should recognize the NO_COLOR
environment variable.
EDIT: already done by github.com/fatih/color
NO_COLOR=true ./gotestsum --format-icons default
Funny story: when I went to school, the teacher gave me either 𝓡 (right) or ✓ (wrong).
If you got all of them correct, you were awarded with the sought for golden ⭐ sticker...
Maybe "nerdfonts" is a bad name, too generic (similar to "unicode", emojis are unicode glyphs too)
For instance, one might want to use some other icon set that is also available in it (like Octicons).
another three icon options...
EDIT: One variant would be to use "dash" (‐) instead of "empty set" (∅), since it looks a lot like Ø*
* Which is a regular character in Danish, like in https://en.wikipedia.org/wiki/%C3%98resund
The format from "testname", while not strictly icons, also has its merits...
For screen readers, or simple terminals without proper unicode support
return icons{
pass: color.GreenString("PASS"),
skip: color.YellowString("SKIP"),
fail: color.RedString("FAIL"),
}.forAction
And these icons are rather subtle, for higher resolution screens:
Now up to 10 different icons, if you count the emojis (hivis)
Rebased and added proper help and environment variable for the format icons:
Side note: you can check the result of the "text" icons with a screen reader:
gotestsum --format-icons text --hide-summary all | espeak -k20
The -k20
causes it to indicate the TEST capital letters with using an increased pitch...
You can also add -x -q
, if you just want to see and not hear the phoneme mnemonics
sk'Ip_
sk'Ip_ s,i:;,Emd'i: sl'aS Int'3:n@L sl'aS s'Igna#lh,and@L@dr,aIv3
p'aas_ s,i:;,Emd'i:_:_: k'aSt
p'aas_ s,i:;,Emd'i: sl'aS t'u:l sl'aS m'eItrIks_:_: k'aSt
sk'Ip_ k'0ntrIb sl'aS n'oUtI2f,aI
p'aas_ s,i:;,Emd'i: sl'aS t'u:l sl'aS sl'oUI2st_:_: k'aSt
sk'Ip_ Int'3:n@L sl'aS d'0traIt3
sk'Ip_ Int'3:n@L sl'aS t'Ekst
sk'Ip_ Int'3:n@L sl'aS l'0g
p'aas_ Int'3:n@L sl'aS 'agrI2g,eIt_:_: k'aSt
p'aas_ Int'3:n@L sl'aS dZ'u:nItksm@L_:_: k'aSt
p'aas_ Int'3:n@L sl'aS f'aIlw0tS3_:_: k'aSt
p'aas_ t'EstdZs@n_:_: k'aSt
d'Vn_ w'0nh'VndrI2d@n n'aInti; 'eIt t'Ests
t'u: sk'Ipt In z'i@roU pOInt f'o@ n'aIn t'u: z
∅ .
∅ cmd/internal/signalhandlerdriver
✓ cmd (cached)
✓ cmd/tool/matrix (cached)
∅ contrib/notify
✓ cmd/tool/slowest (cached)
∅ internal/dotwriter
∅ internal/log
∅ internal/text
✓ internal/junitxml (cached)
✓ internal/aggregate (cached)
✓ internal/filewatcher (cached)
✓ testjson (cached)
DONE 198 tests, 2 skipped in 0.460s
Final tweak, added alternative.
Format icons:
default the original unicode (✓, ∅, ✖)
alternative an alternative unicode (✓, ‐, ✗)
hivis higher visibility unicode (✅, ➖, ❌)
text simple text characters (PASS, SKIP, FAIL)
...
https://www.nerdfonts.com/
Icons from the VS Code glyphs:
Or from the GitHub octicons:
Screenshots with Ubuntu Mono:
Other screenshots with Roboto Mono.