From 0cd3cb510af3a9e22ec33dad1fe4920b1080031e Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 15 Feb 2015 07:40:57 -0800 Subject: [PATCH 1/3] flow: Created branch 'feature/split_tests'. From 042812f38e0730c2abff0a1db50eebb0503e2022 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 15 Feb 2015 07:45:06 -0800 Subject: [PATCH 2/3] move simple parse test to parse_test.go which apply only to the parser. tests in dowcrawler_test.go remain integration/functional tests. --- src/docrawler/docrawler_test.go | 25 ------------------------- src/docrawler/parse_test.go | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 25 deletions(-) create mode 100644 src/docrawler/parse_test.go 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") + } +} From 57b7130ac776734acbe7477e855169b74fb5c905 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Sun, 15 Feb 2015 07:45:16 -0800 Subject: [PATCH 3/3] flow: Closed 'split_tests'.