badguardhome/util/helpers_test.go

15 lines
275 B
Go
Raw Normal View History

2020-02-13 11:14:30 +00:00
package util
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSplitNext(t *testing.T) {
s := " a,b , c "
assert.True(t, SplitNext(&s, ',') == "a")
assert.True(t, SplitNext(&s, ',') == "b")
assert.True(t, SplitNext(&s, ',') == "c" && len(s) == 0)
}