19 lines
340 B
Go
19 lines
340 B
Go
package helpers
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
type Function func(input string) int
|
|
|
|
func Check(t *testing.T, f Function, input string, expected int) {
|
|
if actual := f(input); actual != expected {
|
|
t.Fatalf("Expected %v, got %v", expected, actual)
|
|
}
|
|
}
|
|
|
|
func Format(input string) string {
|
|
return strings.ReplaceAll(input, "\r", "")
|
|
}
|