summaryrefslogtreecommitdiffstats
path: root/parser/pageparser/item_test.go
diff options
context:
space:
mode:
authorJoe Mooring <joe.mooring@veriphor.com>2022-11-17 20:00:49 -0800
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-11-18 09:34:10 +0100
commit00fe7e0408fe1571388608f358faf7dacb9cbaaf (patch)
tree12cc9e31ca6cbc440ec3e61e7b3075b5247643ac /parser/pageparser/item_test.go
parentdf85cb9ae201a892cf53e6bfebdd5f0fe0fde9bd (diff)
hugo/parser: Fix shortcode boolean param parsing
Fixes #10451
Diffstat (limited to 'parser/pageparser/item_test.go')
-rw-r--r--parser/pageparser/item_test.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/parser/pageparser/item_test.go b/parser/pageparser/item_test.go
index db4cc127a..72bb69103 100644
--- a/parser/pageparser/item_test.go
+++ b/parser/pageparser/item_test.go
@@ -38,6 +38,13 @@ func TestItemValTyped(t *testing.T) {
c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, true)
source = []byte("false")
c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, false)
- source = []byte("trued")
+ source = []byte("falsex")
+ c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, "falsex")
+ source = []byte("xfalse")
+ c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, "xfalse")
+ source = []byte("truex")
+ c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, "truex")
+ source = []byte("xtrue")
+ c.Assert(Item{low: 0, high: len(source)}.ValTyped(source), qt.Equals, "xtrue")
}