You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
534 B
Go
27 lines
534 B
Go
2 years ago
|
package shell
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/suite"
|
||
|
)
|
||
|
|
||
|
type UtilTest struct {
|
||
|
suite.Suite
|
||
|
}
|
||
|
|
||
|
func (t *UtilTest) TestCountBackslashSuffixes() {
|
||
|
three := []rune{'a', '\\', 'b', '\\', '\\', '\\'}
|
||
|
t.Equal(3, countBackslashSuffixes(three))
|
||
|
|
||
|
six := []rune{'a', '\\', 'b', '\\', '\\', '\\', '\\', '\\', '\\'}
|
||
|
t.Equal(6, countBackslashSuffixes(six))
|
||
|
|
||
|
zero := []rune{'a', '\\', 'b', '\\', '\\', '\\', 'c'}
|
||
|
t.Equal(0, countBackslashSuffixes(zero))
|
||
|
}
|
||
|
|
||
|
func TestUtilTest(t *testing.T) {
|
||
|
suite.Run(t, new(UtilTest))
|
||
|
}
|