map_test.go 269 B

123456789101112131415161718
  1. package concurrent_test
  2. import (
  3. "github.com/modern-go/concurrent"
  4. "testing"
  5. )
  6. func TestMap_Load(t *testing.T) {
  7. m := concurrent.NewMap()
  8. m.Store("hello", "world")
  9. value, found := m.Load("hello")
  10. if !found {
  11. t.Fail()
  12. }
  13. if value != "world" {
  14. t.Fail()
  15. }
  16. }