Refactoring to reduce package count
* Consolidate util and utils into the same package * Move internal/onboard into internal/cli/onboard * Move maybeOnboard into the onboard package
This commit is contained in:
parent
430a53e7d6
commit
58199a020e
12 changed files with 189 additions and 194 deletions
18
utils/util_test.go
Normal file
18
utils/util_test.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
func TestEscapeAwareRuneCountInString(t *testing.T) {
|
||||
var bold = color.New(color.Bold)
|
||||
var myColor = color.New(color.FgBlue)
|
||||
|
||||
s := myColor.Sprintf("•ABC%s%s", bold.Sprintf("DEF"), "\x1B[00;38;5;244m\x1B[m\x1B[00;38;5;33mGHI\x1B[0m")
|
||||
count := EscapeAwareRuneCountInString(s)
|
||||
if count != 10 {
|
||||
t.Errorf("Count was incorrect, got: %d, want: %d.", count, 10)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue