From 1101dafc90c24800ea053384f5ad7497e7450c4a Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 2 Oct 2017 00:01:01 +0200 Subject: [PATCH] Improved testing --- benchmarks/DB_AnimeList_test.go | 2 +- main_test.go | 2 ++ makefile | 2 +- pages/anime/anime.pixy | 6 ++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/benchmarks/DB_AnimeList_test.go b/benchmarks/DB_AnimeList_test.go index 8d79a521..d16c0da7 100644 --- a/benchmarks/DB_AnimeList_test.go +++ b/benchmarks/DB_AnimeList_test.go @@ -14,7 +14,7 @@ func BenchmarkDBAnimeListGetMap(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { - animeList, _ := arn.GetAnimeList(user) + animeList, _ := arn.GetAnimeList(user.ID) noop(animeList) } }) diff --git a/main_test.go b/main_test.go index 7598d804..4daa0c38 100644 --- a/main_test.go +++ b/main_test.go @@ -24,6 +24,8 @@ func TestRoutes(t *testing.T) { if status := responseRecorder.Code; status != http.StatusOK { t.Errorf("%s | Wrong status code | %v instead of %v", example, status, http.StatusOK) + } else { + t.Logf("%s | Correct status code | %v == %v", example, status, http.StatusOK) } } } diff --git a/makefile b/makefile index 9c2a429c..419a9886 100644 --- a/makefile +++ b/makefile @@ -23,7 +23,7 @@ js: install: $(GOINSTALL) test: - $(GOTEST) + $(GOTEST) github.com/animenotifier/... -v bench: $(GOTEST) -bench . tools: diff --git a/pages/anime/anime.pixy b/pages/anime/anime.pixy index 93235ddc..8adf86b2 100644 --- a/pages/anime/anime.pixy +++ b/pages/anime/anime.pixy @@ -210,8 +210,10 @@ component Anime(anime *arn.Anime, friends []*arn.User, listItems map[*arn.User]* RawIcon("eye") //- a(href="https://translate.google.com/#ja/en/" + episode.Title.Japanese, target="_blank", rel="noopener") //- RawIcon("google") - td.episode-airing-date-start.utc-airing-date(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman() - + if episode.AiringDate.IsValid() + td.episode-airing-date-start.utc-airing-date(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman() + else + td.episode-airing-date-start //- h3.anime-section-name Reviews //- p Coming soon.