Skip to content

Commit

Permalink
storage: fix concurrent map read/write
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 6, 2023
1 parent 71fde81 commit 365251a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,20 @@ func TestCheck(t *testing.T) {
t.Error("check should fail")
}
}

func BenchmarkStorage(b *testing.B) {
cmd := &cobra.Command{}
cmd2 := &cobra.Command{}
b.RunParallel(func(p *testing.PB) {
Gen(cmd).FlagCompletion(ActionMap{
"flag1": ActionValues("a", "b"),
})
Gen(cmd).PositionalCompletion(ActionValues("a", "b"))

Gen(cmd2).FlagCompletion(ActionMap{
"flag2": ActionValues("a", "b"),
})
Gen(cmd).PositionalCompletion(ActionValues("a", "b"))
})

}

0 comments on commit 365251a

Please sign in to comment.