======================================== Type Name Tests ========================================
(t *testing.T)
| 214 | // ======================================== |
| 215 | |
| 216 | func TestType2Name(t *testing.T) { |
| 217 | tests := []struct { |
| 218 | name string |
| 219 | colType int |
| 220 | expected string |
| 221 | }{ |
| 222 | {"String type", colTypeStr, "Str"}, |
| 223 | {"Float type", colTypeFloat, "Num"}, |
| 224 | } |
| 225 | |
| 226 | for _, tt := range tests { |
| 227 | t.Run(tt.name, func(t *testing.T) { |
| 228 | result := type2name(tt.colType) |
| 229 | if result != tt.expected { |
| 230 | t.Errorf("type2name(%d) = %s, want %s", tt.colType, result, tt.expected) |
| 231 | } |
| 232 | }) |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | // Helper function |
| 237 | func contains(s, substr string) bool { |
nothing calls this directly
no test coverage detected