From 0dfb7a7190b5039177627abc0cb8eed48313378b Mon Sep 17 00:00:00 2001 From: Evgeny Kuznetsov Date: Tue, 28 Jan 2020 22:48:55 +0300 Subject: use HTTPS --- main_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'main_test.go') diff --git a/main_test.go b/main_test.go index 8aa272d..b3d1b7f 100644 --- a/main_test.go +++ b/main_test.go @@ -206,3 +206,23 @@ func TestEpisodeURLPrefix(t *testing.T) { t.Fatalf("got %v, want %v", got, want) } } + +func TestEpisodeID(t *testing.T) { + type testval struct { + url string + id string + } + + var tests = []testval{ + {"http://www.radiorus.ru/brand/57083/episode/foo", "http://www.radiorus.ru/brand/57083/episode/foo"}, + {"https://www.radiorus.ru/brand/57083/episode/foo", "http://www.radiorus.ru/brand/57083/episode/foo"}, + } + + for _, test := range tests { + got := episodeID(test.url) + want := test.id + if got != want { + t.Error("want:", want, "got:", got) + } + } +} -- cgit v1.2.3