(t *testing.T)
| 260 | } |
| 261 | |
| 262 | func TestAppendParagraph(t *testing.T) { |
| 263 | tests := []struct { |
| 264 | name string |
| 265 | md string |
| 266 | addition string |
| 267 | want string |
| 268 | }{ |
| 269 | {name: "separates with a blank line", md: "text", addition: "more", want: "text\n\nmore"}, |
| 270 | {name: "empty markdown", md: "", addition: "more", want: "more"}, |
| 271 | {name: "whitespace only markdown", md: " \n\n", addition: "more", want: "more"}, |
| 272 | {name: "empty addition preserves markdown", md: "text \n", addition: "", want: "text \n"}, |
| 273 | {name: "trailing newlines", md: "text\n\n\n", addition: "more", want: "text\n\nmore"}, |
| 274 | {name: "trailing spaces", md: "text ", addition: "more", want: "text\n\nmore"}, |
| 275 | } |
| 276 | |
| 277 | for _, tt := range tests { |
| 278 | t.Run(tt.name, func(t *testing.T) { |
| 279 | assert.Equal(t, tt.want, appendParagraph(tt.md, tt.addition)) |
| 280 | }) |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | func TestUploaderUploadAndAttachDoesNotLeakTheAssetURLIntoAnError(t *testing.T) { |
| 285 | writeFiles(t, "a.png", "b.png") |
nothing calls this directly
no test coverage detected