1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

hugolib: Add Reset method to delete key from Scratch

This commit is contained in:
cmal
2018-03-17 00:13:23 +01:00
committed by Bjørn Erik Pedersen
parent 10fef32de6
commit e46ab29bd2
3 changed files with 23 additions and 0 deletions

View File

@@ -87,6 +87,15 @@ func TestScratchSet(t *testing.T) {
assert.Equal(t, "val", scratch.Get("key"))
}
func TestScratchDelete(t *testing.T) {
t.Parallel()
scratch := newScratch()
scratch.Set("key", "val")
scratch.Delete("key")
scratch.Add("key", "Lucy Parsons")
assert.Equal(t, "Lucy Parsons", scratch.Get("key"))
}
// Issue #2005
func TestScratchInParallel(t *testing.T) {
var wg sync.WaitGroup