mirror of
https://github.com/cubixle/codekata-golang.git
synced 2026-04-24 22:54:43 +01:00
33 lines
469 B
Go
33 lines
469 B
Go
package main
|
|
|
|
import "testing"
|
|
|
|
func Test_compress(t *testing.T) {
|
|
type args struct {
|
|
s string
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
args args
|
|
want string
|
|
}{
|
|
{
|
|
"test1",
|
|
args{"aabcccccaaa"},
|
|
"a2b1c5a3",
|
|
},
|
|
{
|
|
"test2",
|
|
args{"abbccd"},
|
|
"abbccd",
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := compress(tt.args.s); got != tt.want {
|
|
t.Errorf("compress() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|