Passed
Push — master ( df7d70...d7b12b )
by Serhii
01:18
created

timeago.Test_parseJsonIntoLang   A

Complexity

Conditions 4

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 7
dl 0
loc 10
rs 10
c 0
b 0
f 0
nop 1
1
package timeago
2
3
import (
4
	"testing"
5
)
6
7
func Test_parseJsonIntoLang(t *testing.T) {
8
	t.Run("Function returns Lang model with needed values", func(test *testing.T) {
9
		res, err := parseLangSet("langs/ru.json")
10
11
		if err != nil {
12
			t.Errorf("Function parseLangSet must return Lang model, but returned error %v", err)
13
		}
14
15
		if res.Ago != "назад" {
16
			t.Errorf("Function needs to return model with value назад, but returned %v", res.Ago)
17
		}
18
	})
19
}
20