genservice_test.go 448 B

123456789101112131415161718192021222324252627
  1. package generator
  2. import "testing"
  3. func TestUnderscore(t *testing.T) {
  4. type args struct {
  5. s string
  6. }
  7. tests := []struct {
  8. name string
  9. args args
  10. want string
  11. }{
  12. {
  13. name: "remoteIP",
  14. args: args{s: "remoteIP"},
  15. want: "remote_ip",
  16. },
  17. }
  18. for _, tt := range tests {
  19. t.Run(tt.name, func(t *testing.T) {
  20. if got := underscore(tt.args.s); got != tt.want {
  21. t.Errorf("underscore() = %v, want %v", got, tt.want)
  22. }
  23. })
  24. }
  25. }