aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/elapsed_test.go
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2018-09-21 18:53:29 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2018-09-21 22:23:23 -0700
commitbeb7a0cfcb6a5a76d680707a4c458eee51d87c07 (patch)
treef6e23ffbffcdd58f8438e2d2711acb4fa86bb83b /template/elapsed_test.go
parentf244df62936eea307a5fc3f27fb9968527d402ac (diff)
Use unique translation IDs instead of English text as key
Diffstat (limited to 'template/elapsed_test.go')
-rw-r--r--template/elapsed_test.go38
1 files changed, 0 insertions, 38 deletions
diff --git a/template/elapsed_test.go b/template/elapsed_test.go
deleted file mode 100644
index 987833a..0000000
--- a/template/elapsed_test.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2017 Hervé Gouchet. All rights reserved.
-// Use of this source code is governed by the MIT License
-// that can be found in the LICENSE file.
-
-package template // import "miniflux.app/template"
-
-import (
- "fmt"
- "testing"
- "time"
-
- "miniflux.app/locale"
-)
-
-func TestElapsedTime(t *testing.T) {
- var dt = []struct {
- in time.Time
- out string
- }{
- {time.Time{}, NotYet},
- {time.Now().Add(time.Hour), NotYet},
- {time.Now(), JustNow},
- {time.Now().Add(-time.Minute), LastMinute},
- {time.Now().Add(-time.Minute * 40), fmt.Sprintf(Minutes, 40)},
- {time.Now().Add(-time.Hour), LastHour},
- {time.Now().Add(-time.Hour * 3), fmt.Sprintf(Hours, 3)},
- {time.Now().Add(-time.Hour * 32), Yesterday},
- {time.Now().Add(-time.Hour * 24 * 3), fmt.Sprintf(Days, 3)},
- {time.Now().Add(-time.Hour * 24 * 14), fmt.Sprintf(Weeks, 2)},
- {time.Now().Add(-time.Hour * 24 * 60), fmt.Sprintf(Months, 2)},
- {time.Now().Add(-time.Hour * 24 * 365 * 3), fmt.Sprintf(Years, 3)},
- }
- for i, tt := range dt {
- if out := elapsedTime(&locale.Language{}, "Local", tt.in); out != tt.out {
- t.Errorf(`%d. content mismatch for "%v": expected=%q got=%q`, i, tt.in, tt.out, out)
- }
- }
-}