Skip to content

text/template: tests in exec_test.go: T.ComplexZero is float64 instead of complex128 #5649

@gopherbot

Description

@gopherbot

by arnehormann:

Problem:
Tests for complex variables don't test what they are meant to.

The culprit is declared in
https://code.google.com/p/go/source/browse/src/pkg/text/template/exec_test.go#27

The non-complex float64 is then used in tests
https://code.google.com/p/go/source/browse/src/pkg/text/template/exec_test.go#358
https://code.google.com/p/go/source/browse/src/pkg/text/template/exec_test.go#431

In this case, it would probably be better to test against non-zero values.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions