Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package timeago |
||
2 | |||
3 | import "testing" |
||
4 | |||
5 | func TestGetTimeTranslations(t *testing.T) { |
||
6 | t.Parallel() |
||
7 | |||
8 | t.Run("returns 7 items", func(test *testing.T) { |
||
9 | if res := len(getTimeTranslations()); res != 7 { |
||
10 | test.Errorf("Must return 7 items but got %d", res) |
||
11 | } |
||
12 | }) |
||
13 | |||
14 | t.Run("every slice has 3 items", func(test *testing.T) { |
||
15 | for _, slice := range getTimeTranslations() { |
||
16 | if res := len(slice); res != 3 { |
||
17 | test.Errorf("Slice Must return 3 items but got %d", res) |
||
18 | } |
||
22 |