diff --git a/src/docrawler/docrawler_test.go b/src/docrawler/docrawler_test.go index 10dae64..59d7aaa 100644 --- a/src/docrawler/docrawler_test.go +++ b/src/docrawler/docrawler_test.go @@ -70,28 +70,3 @@ func TestSimpleFetch(t *testing.T) { t.Error("fetch succeeded, but content mismatched") } } - -// TestSimpleParse verifies that we can extract URLs (etc.) from a known document -func TestSimpleParse(t *testing.T) { - doc := ` - - - - - - -` - matches, err := parse(doc) - if err != nil { - t.Error(err) - } - if len(matches) != 2 { - t.Error("invalid number of matches in parse") - } - if matches[0] != "/about.html" { - t.Error("match text is invalid") - } - if matches[1] != "/assets/image.png" { - t.Error("match text is invalid") - } -} diff --git a/src/docrawler/parse_test.go b/src/docrawler/parse_test.go new file mode 100644 index 0000000..738f2c4 --- /dev/null +++ b/src/docrawler/parse_test.go @@ -0,0 +1,30 @@ +package main + +import ( + "testing" +) + +// TestSimpleParse verifies that we can extract URLs (etc.) from a known document +func TestSimpleParse(t *testing.T) { + doc := ` + + + + + + +` + matches, err := parse(doc) + if err != nil { + t.Error(err) + } + if len(matches) != 2 { + t.Error("invalid number of matches in parse") + } + if matches[0] != "/about.html" { + t.Error("match text is invalid") + } + if matches[1] != "/assets/image.png" { + t.Error("match text is invalid") + } +}