summaryrefslogtreecommitdiff
path: root/cmd/rescribe/gbook_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/rescribe/gbook_test.go')
-rw-r--r--cmd/rescribe/gbook_test.go17
1 files changed, 16 insertions, 1 deletions
diff --git a/cmd/rescribe/gbook_test.go b/cmd/rescribe/gbook_test.go
index 56b4b40..f7df595 100644
--- a/cmd/rescribe/gbook_test.go
+++ b/cmd/rescribe/gbook_test.go
@@ -8,7 +8,7 @@ import (
"testing"
)
-func Test_getBookIdFromUrl(t *testing.T) {
+func TestGetBookIdFromUrl(t *testing.T) {
cases := []struct {
url string
id string
@@ -29,3 +29,18 @@ func Test_getBookIdFromUrl(t *testing.T) {
})
}
}
+
+func FuzzGetBookIdFromUrl(f *testing.F) {
+ cases := []string {
+ "https://books.google.it/books?id=QjQepCuN8JYC",
+ "https://www.google.it/books/edition/_/VJbr-Oe2au0C",
+ }
+
+ for _, c := range cases {
+ f.Add(c)
+ }
+
+ f.Fuzz(func(t *testing.T, url string) {
+ getBookIdFromUrl(url)
+ })
+}