From a2afdf92bb886aa9ffdfd283a81a4d24df717c1e Mon Sep 17 00:00:00 2001
From: SYM01 <33443792+SYM01@users.noreply.github.com>
Date: Wed, 13 Dec 2023 22:06:40 +0800
Subject: [PATCH] minor improve
---
dfa.go | 4 ++--
sanitizer_fuzz_test.go | 18 ------------------
2 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/dfa.go b/dfa.go
index ba3a0ea..a83884a 100644
--- a/dfa.go
+++ b/dfa.go
@@ -218,7 +218,7 @@ func (w *writer) sNORMAL() (err error) {
}
_, err = w.flush()
- return err
+ return
}
func (w *writer) sNONHTML() (err error) {
@@ -242,7 +242,7 @@ func (w *writer) sNONHTML() (err error) {
}
_, err = w.flush()
- return err
+ return
}
func (w *writer) sLTSIGN() error {
diff --git a/sanitizer_fuzz_test.go b/sanitizer_fuzz_test.go
index 35c1c50..2d7208c 100644
--- a/sanitizer_fuzz_test.go
+++ b/sanitizer_fuzz_test.go
@@ -36,21 +36,3 @@ func FuzzSanitize(f *testing.F) {
}
})
}
-
-func TestSanitize_tmp(t *testing.T) {
- a := []byte(``)
- data := append([]byte(`abcdef(g)`...)
- expected := []byte(`abcdef(g)`)
- ret, err := htmlsanitizer.Sanitize(data)
- if err != nil {
- t.Errorf("unable to Sanitize err: %s", err)
- return
- }
- if !bytes.Equal(ret, expected) {
- t.Errorf("test failed for %s, expect %s, got %s", data, expected, ret)
- return
- }
-}