This is an automated email from the ASF dual-hosted git repository.
LinkinStars pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/answer.git
The following commit(s) were added to refs/heads/dev by this push:
new 0584ca0b test(htmltext): use empty assertions for failed image fetches
0584ca0b is described below
commit 0584ca0b25fdfe0251a0847265bac190222d84c5
Author: LinkinStars <[email protected]>
AuthorDate: Wed Nov 11 18:43:02 2026 +0800
test(htmltext): use empty assertions for failed image fetches
---
pkg/htmltext/htmltext_test.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pkg/htmltext/htmltext_test.go b/pkg/htmltext/htmltext_test.go
index da32956e..20f469a7 100644
--- a/pkg/htmltext/htmltext_test.go
+++ b/pkg/htmltext/htmltext_test.go
@@ -353,7 +353,7 @@ func TestGetPicByUrlReturnsEmptyOnErrorStatus(t *testing.T)
{
}))
defer srv.Close()
- assert.Equal(t, "", GetPicByUrl(srv.URL))
+ assert.Empty(t, GetPicByUrl(srv.URL))
}
// A slow origin must not pin the handler goroutine indefinitely: /favicon.ico
@@ -378,7 +378,7 @@ func TestGetPicByUrlTimesOut(t *testing.T) {
select {
case got := <-done:
- assert.Equal(t, "", got, "a timed-out fetch must yield an empty
result")
+ assert.Empty(t, got, "a timed-out fetch must yield an empty
result")
case <-time.After(10 * time.Second):
t.Fatal("GetPicByUrl did not honour the client timeout")
}
@@ -407,7 +407,7 @@ func TestGetPicByUrlRejectsBodyOverSizeLimit(t *testing.T) {
}))
defer srv.Close()
- assert.Equal(t, "", GetPicByUrl(srv.URL))
+ assert.Empty(t, GetPicByUrl(srv.URL))
}
func TestPicClientHasTimeout(t *testing.T) {