- Introduced .editorconfig for consistent coding styles across the project. - Added .golangci.yml for Go linting configuration. - Updated AGENTS.md to clarify project structure and components. - Enhanced CONTRIBUTING.md with Makefile usage for common tasks. - Updated Dockerfiles to use Go 1.24 and improved build instructions. - Refined README.md and deployment documentation for clarity. - Added testing documentation in testing.md for backend and frontend tests. - Introduced Makefile for streamlined development commands and tasks.
33 lines
920 B
Go
33 lines
920 B
Go
package services_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/andyleap/hnh-map/internal/app/services"
|
|
)
|
|
|
|
func TestFixMultipartContentType_NeedsQuoting(t *testing.T) {
|
|
ct := "multipart/form-data; boundary=----WebKitFormBoundary=abc123"
|
|
got := services.FixMultipartContentType(ct)
|
|
want := `multipart/form-data; boundary="----WebKitFormBoundary=abc123"`
|
|
if got != want {
|
|
t.Fatalf("expected %q, got %q", want, got)
|
|
}
|
|
}
|
|
|
|
func TestFixMultipartContentType_AlreadyQuoted(t *testing.T) {
|
|
ct := `multipart/form-data; boundary="----WebKitFormBoundary"`
|
|
got := services.FixMultipartContentType(ct)
|
|
if got != ct {
|
|
t.Fatalf("expected unchanged, got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestFixMultipartContentType_Normal(t *testing.T) {
|
|
ct := "multipart/form-data; boundary=----WebKitFormBoundary"
|
|
got := services.FixMultipartContentType(ct)
|
|
if got != ct {
|
|
t.Fatalf("expected unchanged, got %q", got)
|
|
}
|
|
}
|