diff --git a/src/docrawler/docrawler_test.go b/src/docrawler/docrawler_test.go index 4b491fb..eacf080 100644 --- a/src/docrawler/docrawler_test.go +++ b/src/docrawler/docrawler_test.go @@ -71,31 +71,6 @@ func TestSimpleFetch(t *testing.T) { } } -// 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.Fatal("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") - } -} - // TestSimpleMap figures out the site map for the site in baseURL func TestSimpleMap(t *testing.T) { pages := docrawl(baseURL) 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") + } +}