diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-07-07 16:11:47 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-07-09 16:03:11 +0200 |
commit | 223bf2800488ad5d38854bbb595d789bc35ebe32 (patch) | |
tree | 84b04f8f50b4450cf5f87943befe31fd9d7b8b90 /hugolib/shortcode_test.go | |
parent | 72b0ccdb010fcdfeb3bb4a955d4fc04529816c0d (diff) |
parser/pageparser: Don't store the byte slices
On its own this change doesn't do any magic, but this is part of a bigger picture about making Hugo leaner in the
memory usage department.
Diffstat (limited to 'hugolib/shortcode_test.go')
-rw-r--r-- | hugolib/shortcode_test.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index 5b8a5c295..3f9190962 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -112,7 +112,7 @@ title: "Shortcodes Galore!" handler := newShortcodeHandler(nil, s) iter := p.Iterator() - short, err := handler.extractShortcode(0, 0, iter) + short, err := handler.extractShortcode(0, 0, p.Input(), iter) test.check(c, short, err) }) @@ -763,7 +763,7 @@ title: "Hugo Rocks!" ) } -func TestShortcodeTypedParams(t *testing.T) { +func TestShortcodeParams(t *testing.T) { t.Parallel() c := qt.New(t) @@ -778,6 +778,7 @@ title: "Hugo Rocks!" types positional: {{< hello true false 33 3.14 >}} types named: {{< hello b1=true b2=false i1=33 f1=3.14 >}} types string: {{< hello "true" trues "33" "3.14" >}} +escaped quoute: {{< hello "hello \"world\"." >}} `).WithTemplatesAdded( @@ -796,6 +797,7 @@ Get: {{ printf "%v (%T)" $b1 $b1 | safeHTML }} "types positional: - 0: true (bool) - 1: false (bool) - 2: 33 (int) - 3: 3.14 (float64)", "types named: - b1: true (bool) - b2: false (bool) - f1: 3.14 (float64) - i1: 33 (int) Get: true (bool) ", "types string: - 0: true (string) - 1: trues (string) - 2: 33 (string) - 3: 3.14 (string) ", + "hello "world". (string)", ) } |