From 2747bd581e1bae0a1436fcde984558304c005333 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Mon, 16 Mar 2026 14:40:53 +0100 Subject: fix(html): invalid parsing of arguments --- html_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'html_test.go') diff --git a/html_test.go b/html_test.go index b7fdf1a..8051b30 100644 --- a/html_test.go +++ b/html_test.go @@ -9,6 +9,9 @@ import ( ) func TestGetHumanFromHTML(t *testing.T) { + if testing.Short() { + t.SkipNow() + } client := http.DefaultClient // using human.json author's website resp, err := client.Get(`https://robida.net/`) @@ -87,6 +90,27 @@ func TestGetURLFromHTML(t *testing.T) { if u.Host != "example.org" { t.Errorf("invalid host: %s", u.Host) } + + realSample := ` + + + + + + ` + u, err = GetURLFromHTML([]byte(realSample), base) + if err != nil { + t.Fatal(err) + } + if u == nil { + t.Fatal("not found") + } + if u.Path != "/human.json" { + t.Errorf("invalid path: %s", u.Path) + } + if u.Host != "example.org" { + t.Errorf("invalid host: %s", u.Host) + } } func TestParseArgs(t *testing.T) { -- cgit v1.2.3