Passed
Pull Request — master (#9)
by Serhii
01:51
created

lang_test.go   A

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 6
eloc 11
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B timeago.TestGetTimeTranslations 0 13 6
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
			}
19
		}
20
	})
21
}
22