@@ -22,7 +22,10 @@ func TestBaseTemplateTranslationOnly(t *testing.T) {
22
22
translations := getTestTranslations ()
23
23
24
24
tpl := New (`<html>{{- T "t" -}}</html>` , template.FuncMap {})
25
- tpl .AddPage (`test` , `` , translations )
25
+ err := tpl .AddPage (`test` , `` , translations )
26
+ if err != nil {
27
+ t .Fail ()
28
+ }
26
29
27
30
var tmp bytes.Buffer
28
31
for _ , l := range translations .Languages () {
@@ -46,7 +49,10 @@ func TestPageTranslationFunction(t *testing.T) {
46
49
translations := getTestTranslations ()
47
50
48
51
tpl := New (`<html>{{- template "content" .C -}}</html>` , template.FuncMap {})
49
- tpl .AddPage (`test` , `{{- T "t" -}}` , translations )
52
+ err := tpl .AddPage (`test` , `{{- T "t" -}}` , translations )
53
+ if err != nil {
54
+ t .Fail ()
55
+ }
50
56
51
57
var tmp bytes.Buffer
52
58
for _ , l := range translations .Languages () {
@@ -72,7 +78,10 @@ func TestPageTranslationVariable(t *testing.T) {
72
78
translations := getTestTranslations ()
73
79
74
80
tpl := New (`<html>{{- template "content" .C -}}</html>` , template.FuncMap {})
75
- tpl .AddPage (`test` , `{{- .T -}}` , translations )
81
+ err := tpl .AddPage (`test` , `{{- .T -}}` , translations )
82
+ if err != nil {
83
+ t .Fail ()
84
+ }
76
85
77
86
var tmp bytes.Buffer
78
87
for _ , l := range translations .Languages () {
@@ -104,7 +113,10 @@ func TestCache(t *testing.T) {
104
113
translations := getTestTranslations ()
105
114
106
115
tpl := New (`<html>{{- T "t" -}}</html>` , template.FuncMap {})
107
- tpl .AddPage (`test` , `` , translations )
116
+ err := tpl .AddPage (`test` , `` , translations )
117
+ if err != nil {
118
+ t .Fail ()
119
+ }
108
120
109
121
var tmp bytes.Buffer
110
122
@@ -131,7 +143,10 @@ func TestPageTokenTranslation(t *testing.T) {
131
143
translations := getTestTranslations ()
132
144
133
145
tpl := New (`` , template.FuncMap {})
134
- tpl .AddPage (`test` , `` , translations )
146
+ err := tpl .AddPage (`test` , `` , translations )
147
+ if err != nil {
148
+ t .Fail ()
149
+ }
135
150
136
151
for _ , l := range translations .Languages () {
137
152
actual := tpl .Translate (`test` , `t` , l )
0 commit comments