File: map_test.go

package info (click to toggle)
golang-github-modern-go-concurrent 1.0.3-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, bookworm-proposed-updates, bullseye, bullseye-backports, forky, sid, trixie
  • size: 104 kB
  • sloc: sh: 9; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 269 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package concurrent_test

import (
	"github.com/modern-go/concurrent"
	"testing"
)

func TestMap_Load(t *testing.T) {
	m := concurrent.NewMap()
	m.Store("hello", "world")
	value, found := m.Load("hello")
	if !found {
		t.Fail()
	}
	if value != "world" {
		t.Fail()
	}
}