From c68448f15187a79c2bed31b6a7b0e3d496069ed2 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 3 Jan 2018 01:39:39 +0100 Subject: unexport --- flood_test.go | 46 +++++++++++++++++++++++----------------------- href_test.go | 34 +++++++++++++++++----------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/flood_test.go b/flood_test.go index 6e7e846..086292c 100644 --- a/flood_test.go +++ b/flood_test.go @@ -4,50 +4,50 @@ import "testing" func TestFlood(t *testing.T) { testCases := []struct { - Input string - Result bool + line string + flood bool }{ { - Input: `! ! ! ! ! ! ! !`, - Result: true, + line: `! ! ! ! ! ! ! !`, + flood: true, }, { - Input: `test test test test abc abc`, - Result: true, + line: `test test test test abc abc`, + flood: true, }, { - Input: `! test ! test ! test ! test !`, - Result: true, + line: `! test ! test ! test ! test !`, + flood: true, }, { - Input: `a b c d e f g h i j`, - Result: false, + line: `a b c d e f g h i j`, + flood: false, }, { - Input: `const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };`, - Result: false, + line: `const union __infinity_un __infinity = { { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f } };`, + flood: false, }, { - Input: `a = b > 3 ? 2 : 4`, - Result: false, + line: `a = b > 3 ? 2 : 4`, + flood: false, }, { - Input: `AAAAAAAAAAAAAAAAAAAA`, - Result: true, + line: `AAAAAAAAAAAAAAAAAAAA`, + flood: true, }, { - Input: `AAAAAAAAAABBBBBBBBBB`, - Result: true, + line: `AAAAAAAAAABBBBBBBBBB`, + flood: true, }, { - Input: `ivy 3 3 rho (iota 9) in 2 6 7 8 9`, - Result: false, + line: `ivy 3 3 rho (iota 9) in 2 6 7 8 9`, + flood: false, }, } for _, tc := range testCases { - t.Run(tc.Input, func(t *testing.T) { - if isFlood(tc.Input) != tc.Result { - t.Errorf("want %v", tc.Result) + t.Run(tc.line, func(t *testing.T) { + if isFlood(tc.line) != tc.flood { + t.Errorf("want %v", tc.flood) } }) } diff --git a/href_test.go b/href_test.go index dfeb091..430eafc 100644 --- a/href_test.go +++ b/href_test.go @@ -4,38 +4,38 @@ import "testing" func TestTitle(t *testing.T) { testCases := []struct { - URL string - Title string + url string + title string }{ { - URL: `https://www.linux.org.ru`, - Title: `LINUX.ORG.RU - Русская информация об ОС Linux`, + url: `https://www.linux.org.ru`, + title: `LINUX.ORG.RU - Русская информация об ОС Linux`, }, { - URL: `http://www.opennet.ru`, - Title: `Проект OpenNet - всё, что связано с открытым ПО, открытыми технологиями, Linux, BSD и Unix`, + url: `http://www.opennet.ru`, + title: `Проект OpenNet - всё, что связано с открытым ПО, открытыми технологиями, Linux, BSD и Unix`, }, { - URL: `http://www.openbsd.org`, - Title: `OpenBSD`, + url: `http://www.openbsd.org`, + title: `OpenBSD`, }, { - URL: `http://undeadly.org`, - Title: `OpenBSD Journal: A resource for the OpenBSD community`, + url: `http://undeadly.org`, + title: `OpenBSD Journal: A resource for the OpenBSD community`, }, { - URL: `https://github.com/dls/house/blob/master/kernel/SimpleExec.hs`, - Title: `house/SimpleExec.hs at master · dls/house · GitHub`, + url: `https://github.com/dls/house/blob/master/kernel/SimpleExec.hs`, + title: `house/SimpleExec.hs at master · dls/house · GitHub`, }, } for _, tc := range testCases { - t.Run(tc.URL, func(t *testing.T) { - title, err := getTitle(tc.URL) + t.Run(tc.url, func(t *testing.T) { + title, err := getTitle(tc.url) if err != nil { - t.Error(tc.URL, err) + t.Error(tc.url, err) } - if title != tc.Title { - t.Errorf("got %v, want %v", title, tc.Title) + if title != tc.title { + t.Errorf("got %v, want %v", title, tc.title) } }) } -- cgit v1.2.3