You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
448 B
27 lines
448 B
package generator |
|
|
|
import "testing" |
|
|
|
func TestUnderscore(t *testing.T) { |
|
type args struct { |
|
s string |
|
} |
|
tests := []struct { |
|
name string |
|
args args |
|
want string |
|
}{ |
|
{ |
|
name: "remoteIP", |
|
args: args{s: "remoteIP"}, |
|
want: "remote_ip", |
|
}, |
|
} |
|
for _, tt := range tests { |
|
t.Run(tt.name, func(t *testing.T) { |
|
if got := underscore(tt.args.s); got != tt.want { |
|
t.Errorf("underscore() = %v, want %v", got, tt.want) |
|
} |
|
}) |
|
} |
|
}
|
|
|