shithub: hugo

Download patch

ref: 00f07c5374d859057c6e7c4731000b5978364819
parent: 43742e0277216f241ea2ee9ecf9e95b3e0f6105d
author: bep <[email protected]>
date: Wed Mar 11 06:25:53 EDT 2015

doArithmetic: add test for division by zero

--- a/tpl/template_test.go
+++ b/tpl/template_test.go
@@ -123,10 +123,10 @@
 		{uint8(2), uint8(2), '*', uint64(4)},
 		{uint16(4), uint8(2), '/', uint64(2)},
 		{4, 2, '¤', false},
+		{4, 0, '/', false},
 	} {
 		// TODO(bep): Take precision into account.
 		result, err := doArithmetic(this.a, this.b, this.op)
-
 		if b, ok := this.expect.(bool); ok && !b {
 			if err == nil {
 				t.Errorf("[%d] doArethmic didn't return an expected error", i)