Skip to content

Commit

Permalink
Add emoticons to the nerdfonts icon formats
Browse files Browse the repository at this point in the history
  • Loading branch information
afbjorklund committed Sep 19, 2023
1 parent 6bbf019 commit 857ce64
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Format icons:
* nerdfonts requires a font from https://www.nerdfonts.com/
codicons   
octicons   
emoticons 󰇵 󰇶 󰇸
Commands:
%[1]s tool slowest find or skip the slowest tests
Expand Down
1 change: 1 addition & 0 deletions cmd/testdata/gotestsum-help-text
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Format icons:
* nerdfonts requires a font from https://www.nerdfonts.com/
codicons   
octicons   
emoticons 󰇵 󰇶 󰇸

Commands:
gotestsum tool slowest find or skip the slowest tests
Expand Down
7 changes: 7 additions & 0 deletions testjson/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,13 @@ func getIconFunc(opts FormatOptions) func(Action) string {
fail: "\uf52f", // oct-x_circle
color: true,
}.forAction
case opts.Icons == "emoticons":
return icons{
pass: "\U000f01f5", // md-emoticon_happy_outline
skip: "\U000f01f6", // md-emoticon_neutral_outline
fail: "\U000f01f8", // md-emoticon_sad_outline
color: true,
}.forAction
default:
return icons{
pass: "✓", // CHECK MARK
Expand Down
7 changes: 7 additions & 0 deletions testjson/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ func TestFormats_DefaultGoTestJson(t *testing.T) {
},
expectedOut: "format/pkgname-octicons.out",
},
{
name: "pkgname with emoticons",
format: func(out io.Writer) EventFormatter {
return pkgNameFormat(out, FormatOptions{Icons: "emoticons"})
},
expectedOut: "format/pkgname-emoticons.out",
},
{
name: "pkgname with hide-empty",
format: func(out io.Writer) EventFormatter {
Expand Down
5 changes: 5 additions & 0 deletions testjson/testdata/format/pkgname-emoticons.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
󰇸 testjson/internal/badmain (1ms)
󰇶 testjson/internal/empty (cached)
󰇵 testjson/internal/good (cached)
󰇸 testjson/internal/parallelfails (20ms)
󰇸 testjson/internal/withfails (20ms)

0 comments on commit 857ce64

Please sign in to comment.