summaryrefslogtreecommitdiffstats
path: root/parser/pageparser/pageparser_intro_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-09-29 14:51:51 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-09-29 23:22:41 +0200
commit329e88db1f6d043d32c7083570773dccfd4f11fc (patch)
treea4bab342aa28523be8c854ceb88fece17f634410 /parser/pageparser/pageparser_intro_test.go
parente073f4efb1345f6408000ef3f389873f8cf7179e (diff)
downloadhugo-329e88db1f6d043d32c7083570773dccfd4f11fc.tar.gz
hugo-329e88db1f6d043d32c7083570773dccfd4f11fc.zip
Support typed bool, int and float in shortcode params
This means that you now can do: {{< vidur 9KvBeKu false true 32 3.14 >}} And the boolean and numeric values will be converted to `bool`, `int` and `float64`. If you want these to be strings, they must be quoted: {{< vidur 9KvBeKu "false" "true" "32" "3.14" >}} Fixes #6371
Diffstat (limited to 'parser/pageparser/pageparser_intro_test.go')
-rw-r--r--parser/pageparser/pageparser_intro_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/parser/pageparser/pageparser_intro_test.go b/parser/pageparser/pageparser_intro_test.go
index 3e5bac872..0f20ae5a1 100644
--- a/parser/pageparser/pageparser_intro_test.go
+++ b/parser/pageparser/pageparser_intro_test.go
@@ -27,7 +27,7 @@ type lexerTest struct {
}
func nti(tp ItemType, val string) Item {
- return Item{tp, 0, []byte(val)}
+ return Item{tp, 0, []byte(val), false}
}
var (
@@ -119,6 +119,7 @@ func equal(i1, i2 []Item) bool {
if i1[k].Type != i2[k].Type {
return false
}
+
if !reflect.DeepEqual(i1[k].Val, i2[k].Val) {
return false
}