mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-20 20:21:46 +00:00
doArithmetic: add test for division by zero
This commit is contained in:
parent
43742e0277
commit
00f07c5374
1 changed files with 1 additions and 1 deletions
|
@ -123,10 +123,10 @@ func TestArethmic(t *testing.T) {
|
||||||
{uint8(2), uint8(2), '*', uint64(4)},
|
{uint8(2), uint8(2), '*', uint64(4)},
|
||||||
{uint16(4), uint8(2), '/', uint64(2)},
|
{uint16(4), uint8(2), '/', uint64(2)},
|
||||||
{4, 2, '¤', false},
|
{4, 2, '¤', false},
|
||||||
|
{4, 0, '/', false},
|
||||||
} {
|
} {
|
||||||
// TODO(bep): Take precision into account.
|
// TODO(bep): Take precision into account.
|
||||||
result, err := doArithmetic(this.a, this.b, this.op)
|
result, err := doArithmetic(this.a, this.b, this.op)
|
||||||
|
|
||||||
if b, ok := this.expect.(bool); ok && !b {
|
if b, ok := this.expect.(bool); ok && !b {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
t.Errorf("[%d] doArethmic didn't return an expected error", i)
|
t.Errorf("[%d] doArethmic didn't return an expected error", i)
|
||||||
|
|
Loading…
Reference in a new issue