Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tohrusky committed Aug 23, 2023
1 parent 8b3d7bd commit fa5ab4e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sensitive/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ func TestLoadNetWordDict(t *testing.T) {
}
}

func TestLoadNetWordDictError(t *testing.T) {
filter := New()
// 使用恶意的URL触发Error
url := "https://dfsyyymaliciousourl.com"

err := filter.LoadNetWordDict(url)
fmt.Println(err.Error())
if err == nil {
t.Errorf("Error not triggered")
}
}

func TestLoad(t *testing.T) {
filter := New()
var r io.Reader
Expand Down

0 comments on commit fa5ab4e

Please sign in to comment.