diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-29 10:44:09 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-29 10:44:09 +0100 |
commit | df20b05463fef42aba93d5208e410a7ecc56da5d (patch) | |
tree | ea09dcb297175ffd2d8c5d93174b9f9a91d8c27c /resource/resource_test.go | |
parent | 863a812e07193541b42732b0e227f3d320433f01 (diff) |
resource: Make resource counters for name and title independent
This is the most flexible with the current syntax, and probably what most people would expcect.
Updates #4335
Diffstat (limited to 'resource/resource_test.go')
-rw-r--r-- | resource/resource_test.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/resource/resource_test.go b/resource/resource_test.go index fc6416e6a..1ff979846 100644 --- a/resource/resource_test.go +++ b/resource/resource_test.go @@ -280,14 +280,14 @@ func TestAssignMetadata(t *testing.T) { }, }, func(err error) { assert.NoError(err) - assert.Equal("Resource #1", logo2.Title()) + assert.Equal("Resource #2", logo2.Title()) assert.Equal("Logo Name #1", logo2.Name()) - assert.Equal("Resource #2", logo1.Title()) + assert.Equal("Resource #4", logo1.Title()) assert.Equal("Logo Name #2", logo1.Name()) assert.Equal("Resource #1", foo2.Title()) - assert.Equal("Resource #2", foo1.Title()) + assert.Equal("Resource #3", foo1.Title()) assert.Equal("Name #2", foo1.Name()) - assert.Equal("Resource #3", foo3.Title()) + assert.Equal("Resource #5", foo3.Title()) assert.Equal(logo2, resources.GetByPrefix("logo name #1")) @@ -305,15 +305,13 @@ func TestAssignMetadata(t *testing.T) { }, func(err error) { assert.NoError(err) assert.Equal("Third Logo #1", logo3.Title()) - assert.Equal("Name #1", logo3.Name()) + assert.Equal("Name #3", logo3.Name()) assert.Equal("Other Logo #1", logo2.Title()) assert.Equal("Name #1", logo2.Name()) assert.Equal("Other Logo #2", logo1.Title()) assert.Equal("Name #2", logo1.Name()) }}, - // Start counting first time :counter is used - // See https://github.com/gohugoio/hugo/issues/4335 {[]map[string]interface{}{ map[string]interface{}{ "title": "Third Logo", |