@@ -194,6 +194,48 @@ var helperTests = []Test{
194
194
nil , nil , nil ,
195
195
`` ,
196
196
},
197
+ {
198
+ "#ifGt helper with true literal" ,
199
+ `{{#ifGt foo 10}}foo is greater than 10{{/ifGt}}` ,
200
+ map [string ]interface {}{"foo" : 11 },
201
+ nil , nil , nil ,
202
+ `foo is greater than 10` ,
203
+ },
204
+ {
205
+ "#ifGt helper with false literal" ,
206
+ `{{#ifGt foo 10}}foo is greater than 10{{/ifGt}}` ,
207
+ map [string ]interface {}{"foo" : 5 },
208
+ nil , nil , nil ,
209
+ `` ,
210
+ },
211
+ {
212
+ "#ifGt helper with true literal from params" ,
213
+ `{{#ifGt foo bar}}foo is greater than 10{{/ifGt}}` ,
214
+ map [string ]interface {}{"foo" : 5 , "bar" : 0 },
215
+ nil , nil , nil ,
216
+ `foo is greater than 10` ,
217
+ },
218
+ {
219
+ "#ifGt helper with string comparison, is improper imput should return empty string" ,
220
+ `{{#ifGt foo bar}}foo is greater than 10{{/ifGt}}` ,
221
+ map [string ]interface {}{"foo" : "5" , "bar" : "0" },
222
+ nil , nil , nil ,
223
+ `` ,
224
+ },
225
+ {
226
+ "#ifGt helper with false literal from params" ,
227
+ `{{#ifGt foo bar}}foo is greater than bar{{/ifGt}}` ,
228
+ map [string ]interface {}{"foo" : 5 , "bar" : 0 },
229
+ nil , nil , nil ,
230
+ `foo is greater than bar` ,
231
+ },
232
+ {
233
+ "#ifGt helper with else condition" ,
234
+ `{{#ifGt foo bar}}foo is greater than bar{{else}}foo is not greater than bar{{/ifGt}}` ,
235
+ map [string ]interface {}{"foo" : 0 , "bar" : 5 },
236
+ nil , nil , nil ,
237
+ `foo is not greater than bar` ,
238
+ },
197
239
{
198
240
"#equal helper inside HTML tag" ,
199
241
`<option value="test" {{#equal value "test"}}selected{{/equal}}>Test</option>` ,
0 commit comments