Skip to content

Instantly share code, notes, and snippets.

@cyantarek
Created February 8, 2020 16:12
Show Gist options
  • Save cyantarek/9c3deaddabd8776c2e517659a7702438 to your computer and use it in GitHub Desktop.
Save cyantarek/9c3deaddabd8776c2e517659a7702438 to your computer and use it in GitHub Desktop.
package reversestring
import (
"testing"
)
func TestReverseString1(t *testing.T) {
type args struct {
s string
}
tests := []struct {
name string
args args
want string
}{
{
name: "testing empty",
args: args{
s:"",
},
want: "",
},
{
name: "testing hello",
args: args{
s:"hello",
},
want: "olleh",
},
{
name: "testing question",
args: args{
s:"why am I?",
},
want: "?I ma yhw",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := ReverseString(tt.args.s); got != tt.want {
t.Errorf("ReverseString() = %v, want %v", got, tt.want)
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment