package extractor import "testing" func TestArticle_ZeroValue(t *testing.T) { var a Article if a.Title != "" || a.Content != "" || a.Length != 0 { t.Error("zero-value Article should have empty fields") } } func TestArticle_FieldAssignment(t *testing.T) { a := Article{ Title: "Test Title", Content: "

hello

", TextContent: "hello", Length: 5, Excerpt: "hello", Byline: "Author", SiteName: "Example", Lang: "en", } if a.Title != "Test Title" { t.Errorf("Title = %q, want %q", a.Title, "Test Title") } if a.Length != 5 { t.Errorf("Length = %d, want 5", a.Length) } }