You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
699 B
29 lines
699 B
6 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"github.com/stretchr/testify/suite"
|
||
|
"path"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
type BasenameTestSuite struct {
|
||
|
suite.Suite
|
||
|
}
|
||
|
|
||
|
func (suite *BasenameTestSuite) TestEmptySuffix() {
|
||
|
assert.Equal(suite.T(), "go-coreutils", basename(path.Join("tomo", "go-coreutils"), ""))
|
||
|
}
|
||
|
|
||
|
func (suite *BasenameTestSuite) TestSuffixNotInPath() {
|
||
|
assert.Equal(suite.T(), "go-coreutils", basename(path.Join("tomo", "go-coreutils"), ".git"))
|
||
|
}
|
||
|
|
||
|
func (suite *BasenameTestSuite) TestSuffixInPath() {
|
||
|
assert.Equal(suite.T(), "go-coreutils", basename(path.Join("tomo", "go-coreutils"), ".git"))
|
||
|
}
|
||
|
|
||
|
func TestBasenameTestSuite(t *testing.T) {
|
||
|
suite.Run(t, new(BasenameTestSuite))
|
||
|
}
|