(t *testing.T)
| 51 | } |
| 52 | |
| 53 | func TestConvertToMap(t *testing.T) { |
| 54 | type args struct { |
| 55 | args []string |
| 56 | } |
| 57 | tests := []struct { |
| 58 | name string |
| 59 | args args |
| 60 | want Data |
| 61 | }{ |
| 62 | { |
| 63 | name: "convert slice to map", |
| 64 | args: args{ |
| 65 | []string{ |
| 66 | "TICKET_ID=ABC-1234", |
| 67 | "Name=John Doe", |
| 68 | }, |
| 69 | }, |
| 70 | want: Data{ |
| 71 | "Name": "John Doe", |
| 72 | "TICKET_ID": "ABC-1234", |
| 73 | }, |
| 74 | }, |
| 75 | } |
| 76 | for _, tt := range tests { |
| 77 | t.Run(tt.name, func(t *testing.T) { |
| 78 | if got := ConvertToMap(tt.args.args); !reflect.DeepEqual(got, tt.want) { |
| 79 | t.Errorf("ConvertToMap() = %v, want %v", got, tt.want) |
| 80 | } |
| 81 | }) |
| 82 | } |
| 83 | } |
nothing calls this directly
no test coverage detected