(t *testing.T)
| 23 | ) |
| 24 | |
| 25 | func Test_addLocal(t *testing.T) { |
| 26 | values, _ := url.ParseQuery("charset=utf8mb4&parseTime=True") |
| 27 | type args struct { |
| 28 | query url.Values |
| 29 | } |
| 30 | tests := []struct { |
| 31 | name string |
| 32 | args args |
| 33 | want string |
| 34 | }{ |
| 35 | { |
| 36 | name: "test add local", |
| 37 | args: args{ |
| 38 | query: values, |
| 39 | }, |
| 40 | want: "charset=utf8mb4&loc=Local&parseTime=True", |
| 41 | }, |
| 42 | { |
| 43 | name: "test add local", |
| 44 | args: args{ |
| 45 | query: url.Values{ |
| 46 | "local": []string{"abc"}, |
| 47 | }, |
| 48 | }, |
| 49 | want: "loc=Local&local=abc", |
| 50 | }, |
| 51 | { |
| 52 | name: "test add local", |
| 53 | args: args{ |
| 54 | query: url.Values{ |
| 55 | "loc": []string{"abc"}, |
| 56 | }, |
| 57 | }, |
| 58 | want: "loc=abc", |
| 59 | }, |
| 60 | } |
| 61 | for _, tt := range tests { |
| 62 | t.Run(tt.name, func(t *testing.T) { |
| 63 | if got := sanitizeQuery(tt.args.query); got != tt.want { |
| 64 | t.Errorf("sanitizeQuery() = %v, want %v", got, tt.want) |
| 65 | } |
| 66 | }) |
| 67 | } |
| 68 | } |
nothing calls this directly
no test coverage detected