blob: 05982cc11be39139d524cbda2f1cefb07d73bbb3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
package fake
import (
"testing"
)
func TestDates(t *testing.T) {
for _, lang := range GetLangs() {
SetLang(lang)
v := WeekDay()
if v == "" {
t.Errorf("WeekDay failed with lang %s", lang)
}
v = WeekDayShort()
if v == "" {
t.Errorf("WeekDayShort failed with lang %s", lang)
}
n := WeekdayNum()
if n < 0 || n > 7 {
t.Errorf("WeekdayNum failed with lang %s", lang)
}
v = Month()
if v == "" {
t.Errorf("Month failed with lang %s", lang)
}
v = MonthShort()
if v == "" {
t.Errorf("MonthShort failed with lang %s", lang)
}
n = MonthNum()
if n < 0 || n > 31 {
t.Errorf("MonthNum failed with lang %s", lang)
}
n = Year(1950, 2020)
if n < 1950 || n > 2020 {
t.Errorf("Year failed with lang %s", lang)
}
}
}
|