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) } }) } }