2017-01-14 12:34:22 -02:00
|
|
|
package repos
|
2016-12-31 13:30:00 -02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
2016-12-31 14:07:58 -02:00
|
|
|
|
2016-12-31 13:30:00 -02:00
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestSplit(t *testing.T) {
|
|
|
|
assert := assert.New(t)
|
2017-01-14 12:34:22 -02:00
|
|
|
a, b := split("a/b")
|
2016-12-31 13:30:00 -02:00
|
|
|
assert.Equal("a", a)
|
|
|
|
assert.Equal("b", b)
|
2017-01-19 09:05:20 +01:00
|
|
|
|
|
|
|
a, b = split("")
|
|
|
|
assert.Equal("", a)
|
|
|
|
assert.Equal("", b)
|
|
|
|
|
|
|
|
a, b = split("a")
|
|
|
|
assert.Equal("a", a)
|
|
|
|
assert.Equal("", b)
|
|
|
|
|
|
|
|
a, b = split("a/")
|
|
|
|
assert.Equal("a", a)
|
|
|
|
assert.Equal("", b)
|
|
|
|
|
|
|
|
a, b = split("/b")
|
|
|
|
assert.Equal("", a)
|
|
|
|
assert.Equal("b", b)
|
2016-12-31 13:30:00 -02:00
|
|
|
}
|