Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions glyph/glyph.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ var (
user = Variants{"", "◆", ">"}
signOut = Variants{"", "⏻", ">"}
clock = Variants{"", "◰", ">"}
star = Variants{"", "✦", "*"}
rocket = Variants{"", "🚀", ">"}
)

// StatusOK returns the healthy status dot for the current mode.
Expand Down Expand Up @@ -185,6 +187,12 @@ func Google() string { return google.String() }
// Diamond returns the diamond glyph for the current mode.
func Diamond() string { return diamond.String() }

// Star returns a star glyph for the current mode.
func Star() string { return star.String() }

// Rocket returns a rocket glyph for the current mode.
func Rocket() string { return rocket.String() }

// History returns the history/recent-activity glyph for the current mode.
func History() string { return history.String() }

Expand Down
6 changes: 6 additions & 0 deletions glyph/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ func (g Set) Google() string { return g.of(google) }
// Diamond renders the diamond in this set's mode.
func (g Set) Diamond() string { return g.of(diamond) }

// Star renders the star glyph in this set's mode.
func (g Set) Star() string { return g.of(star) }

// Rocket renders the rocket glyph in this set's mode.
func (g Set) Rocket() string { return g.of(rocket) }

// History renders the history icon in this set's mode.
func (g Set) History() string { return g.of(history) }

Expand Down
25 changes: 25 additions & 0 deletions glyph/space_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package glyph

import "testing"

func TestStarAndRocketVariants(t *testing.T) {
for _, tc := range []struct {
name string
v Variants
fn func() string
set func(Set) string
want map[Mode]string
}{
{"star", star, Star, Set.Star, map[Mode]string{ModeNerd: "", ModeUnicode: "✦", ModeNone: "*"}},
{"rocket", rocket, Rocket, Set.Rocket, map[Mode]string{ModeNerd: "", ModeUnicode: "🚀", ModeNone: ">"}},
} {
for mode, want := range tc.want {
if got := tc.v.stringIn(mode); got != want {
t.Errorf("%s variant %v = %q, want %q", tc.name, mode, got, want)
}
if got := tc.set(SetFor(mode)); got != want {
t.Errorf("Set.%s variant %v = %q, want %q", tc.name, mode, got, want)
}
}
}
}
Loading