aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/parse/parse_test.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2015-05-01 15:33:08 -0700
committerRob Pike <r@golang.org>2015-05-03 00:45:13 +0000
commit409420c08893dad4c112fc1a7fa2568cc0f8a98c (patch)
tree1103476ce49a634c4b4af843a273a4011844010f /src/text/template/parse/parse_test.go
parentd5ff441d9a27ea9173c0334f74591f2184931eee (diff)
downloadgo-409420c08893dad4c112fc1a7fa2568cc0f8a98c.tar.xz
text/template/parse: huge integers are not floats
Ideal constants in the template package are a little different from Go. This is a case that slipped through the cracks: A huge integer number was accepted as a floating-point number, but this loses precision and is confusing. Also, the code in the template package (as opposed to the parse package) wasn't expecting it. Root this out at the source: If an integer doesn't fit an int64 or uint64, complain right away. Change-Id: I375621e6f5333c4d53f053a3c84a9af051711b7a Reviewed-on: https://go-review.googlesource.com/9651 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/text/template/parse/parse_test.go')
-rw-r--r--src/text/template/parse/parse_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/text/template/parse/parse_test.go b/src/text/template/parse/parse_test.go
index a2ca98b0b1..808f9a0b5e 100644
--- a/src/text/template/parse/parse_test.go
+++ b/src/text/template/parse/parse_test.go
@@ -69,6 +69,7 @@ var numberTests = []numberTest{
{text: "1+2."},
{text: "'x"},
{text: "'xx'"},
+ {text: "'433937734937734969526500969526500'"}, // Integer too large - issue 10634.
// Issue 8622 - 0xe parsed as floating point. Very embarrassing.
{"0xef", true, true, true, false, 0xef, 0xef, 0xef, 0},
}