generated from VLADIMIR/template
add cleaner tests
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
package cleaner
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_service_ClearCode(t *testing.T) {
|
||||
tests := []struct {
|
||||
code string
|
||||
want string
|
||||
}{
|
||||
{
|
||||
code: "ы",
|
||||
want: "ы",
|
||||
},
|
||||
{
|
||||
code: "Ы",
|
||||
want: "ы",
|
||||
},
|
||||
{
|
||||
code: "Ы-1",
|
||||
want: "ы1",
|
||||
},
|
||||
{
|
||||
code: "[Ы]",
|
||||
want: "ы",
|
||||
},
|
||||
{
|
||||
code: "([Ы])",
|
||||
want: "ы",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(fmt.Sprintf("%s->%s", tt.code, tt.want), func(t *testing.T) {
|
||||
var s service
|
||||
got := s.ClearCode(tt.code)
|
||||
if got != tt.want {
|
||||
t.Errorf("ClearCode() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user