aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/text/template/exec_test.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2014-09-03 15:57:03 -0700
committerRob Pike <r@golang.org>2014-09-03 15:57:03 -0700
commit55fa7659c990701b3b7fb21e5364585793b9e452 (patch)
tree0c6353026ed26f946c29aac8b92305aa0c1a81dc /src/pkg/text/template/exec_test.go
parent5ea69978fd07abdd4bb5ed63dfb38700389493c6 (diff)
downloadgo-55fa7659c990701b3b7fb21e5364585793b9e452.tar.xz
text/template: 0xef is an integer, not a floating-point value.
The discriminator in the execution engine was stupid. Add a test to the parse package too. The problem wasn't there but the particular case ('e' in a hex integer) was not covered. Fixes #8622. LGTM=ruiu R=golang-codereviews, ruiu CC=golang-codereviews https://golang.org/cl/133530043
Diffstat (limited to 'src/pkg/text/template/exec_test.go')
-rw-r--r--src/pkg/text/template/exec_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pkg/text/template/exec_test.go b/src/pkg/text/template/exec_test.go
index 868f2cb94c..663aaf3af8 100644
--- a/src/pkg/text/template/exec_test.go
+++ b/src/pkg/text/template/exec_test.go
@@ -514,6 +514,11 @@ var execTests = []execTest{
{"bug10", "{{mapOfThree.three}}-{{(mapOfThree).three}}", "3-3", 0, true},
// Dereferencing nil pointer while evaluating function arguments should not panic. Issue 7333.
{"bug11", "{{valueString .PS}}", "", T{}, false},
+ // 0xef gave constant type float64. Issue 8622.
+ {"bug12xe", "{{printf `%T` 0xef}}", "int", T{}, true},
+ {"bug12xE", "{{printf `%T` 0xEE}}", "int", T{}, true},
+ {"bug12Xe", "{{printf `%T` 0Xef}}", "int", T{}, true},
+ {"bug12XE", "{{printf `%T` 0XEE}}", "int", T{}, true},
}
func zeroArgs() string {