Files
tmux-themepack/test/test_helpers.go
Jim Myhrberg 6f3a16ae58 feat(overrides): Add additional prefix/suffix support
Allows a higher-level prefixes and suffixes by allowing it directly on
`@theme-*` options, which are what are set directly against Tmux's
options.

These are the prefix/suffix options added:

- `@theme-status-left-prefix`
- `@theme-status-left-suffix`
- `@theme-status-right-prefix`
- `@theme-status-right-suffix`
- `@theme-window-status-current-prefix`
- `@theme-window-status-current-suffix`
- `@theme-window-status-prefix`
- `@theme-window-status-suffix`

As they are applied on the highest level, it means they work on ALL
themes, including the `default` theme.

The `@themepack-*` prefix/suffix options still work too, but only for
themes that uses them and have three separate text areas on the left and
right status.
2019-12-22 23:10:59 +00:00

19 lines
400 B
Go

package test
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func assertHasPrefix(t *testing.T, s, prefix string) {
assert.Truef(t, strings.HasPrefix(s, prefix),
"Expected \"%s\" to begin with \"%s\"", s, prefix)
}
func assertHasSuffix(t *testing.T, s, prefix string) {
assert.Truef(t, strings.HasSuffix(s, prefix),
"Expected \"%s\" to end with \"%s\"", s, prefix)
}