mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-15 11:57:55 +08:00
28 lines
606 B
Go
28 lines
606 B
Go
package cli
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/elves/elvish/pkg/tt"
|
|
"github.com/elves/elvish/pkg/ui"
|
|
)
|
|
|
|
func TestModeLine(t *testing.T) {
|
|
testModeLine(t, tt.Fn("ModeLine", ModeLine))
|
|
}
|
|
|
|
func TestModePrompt(t *testing.T) {
|
|
testModeLine(t, tt.Fn("ModePrompt",
|
|
func(s string, b bool) ui.Text { return ModePrompt(s, b)() }))
|
|
}
|
|
|
|
func testModeLine(t *testing.T, fn *tt.FnToTest) {
|
|
tt.Test(t, fn, tt.Table{
|
|
tt.Args("TEST", false).Rets(
|
|
ui.T("TEST", ui.Bold, ui.FgWhite, ui.BgMagenta)),
|
|
tt.Args("TEST", true).Rets(
|
|
ui.T("TEST", ui.Bold, ui.FgWhite, ui.BgMagenta).
|
|
ConcatText(ui.T(" "))),
|
|
})
|
|
}
|