File size: 378 Bytes
ca7217f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | package convertor
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestReplaceSpaceAll(t *testing.T) {
for _, unit := range []struct {
origin, expect string
}{
{"Hello, world!", "Hello,world!"},
{"Hello,\tworld!", "Hello,world!"},
{"\t\tHe\tllo, \tworld! \t", "Hello,world!"},
} {
assert.Equal(t, unit.expect, ReplaceSpaceAll(unit.origin))
}
}
|