(t *testing.T)
| 540 | } |
| 541 | |
| 542 | func TestAppendParagraph(t *testing.T) { |
| 543 | tests := []struct { |
| 544 | name string |
| 545 | md string |
| 546 | addition string |
| 547 | want string |
| 548 | }{ |
| 549 | {name: "separates with a blank line", md: "text", addition: "more", want: "text\n\nmore"}, |
| 550 | {name: "empty markdown", md: "", addition: "more", want: "more"}, |
| 551 | {name: "whitespace only markdown", md: " \n\n", addition: "more", want: "more"}, |
| 552 | {name: "empty addition preserves markdown", md: "text \n", addition: "", want: "text \n"}, |
| 553 | {name: "trailing newlines", md: "text\n\n\n", addition: "more", want: "text\n\nmore"}, |
| 554 | {name: "trailing spaces", md: "text ", addition: "more", want: "text\n\nmore"}, |
| 555 | } |
| 556 | |
| 557 | for _, tt := range tests { |
| 558 | t.Run(tt.name, func(t *testing.T) { |
| 559 | assert.Equal(t, tt.want, appendParagraph(tt.md, tt.addition)) |
| 560 | }) |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | func TestUploaderUploadAndAttachDoesNotLeakTheAssetURLIntoAnError(t *testing.T) { |
| 565 | writeFiles(t, "a.png", "b.png") |
nothing calls this directly
no test coverage detected