for _, arg := range args {
v = s.evalArg(dot, argType, arg).Interface().(reflect.Value)
if truth(v) == (name == "or") {
- break
+ return v
}
}
+ if final != missingVal {
+ v = s.validateType(final, argType)
+ }
return v
}
{"and short-circuit", "{{and 1 0 (die)}}", "0", nil, true},
{"or short-circuit2", "{{or 0 0 (die)}}", "", nil, false},
{"and short-circuit2", "{{and 1 1 (die)}}", "", nil, false},
+ {"and pipe-true", "{{1 | and 1}}", "1", nil, true},
+ {"and pipe-false", "{{0 | and 1}}", "0", nil, true},
+ {"or pipe-true", "{{1 | or 0}}", "1", nil, true},
+ {"or pipe-false", "{{0 | or 0}}", "0", nil, true},
{"boolean if", "{{if and true 1 `hi`}}TRUE{{else}}FALSE{{end}}", "TRUE", tVal, true},
{"boolean if not", "{{if and true 1 `hi` | not}}TRUE{{else}}FALSE{{end}}", "FALSE", nil, true},