map_test.go 321 B

12345678910111213141516171819
  1. package jconcurrency
  2. import (
  3. "log"
  4. "testing"
  5. )
  6. func Test_map(t *testing.T) {
  7. jm := NewJM()
  8. jm.Set("a", 1)
  9. jm.Set(1, 3)
  10. log.Println("key 1 :", jm.IsExists(1))
  11. jm.Del(1)
  12. log.Println("key 1 :", jm.IsExists(1))
  13. jm.SetIfNoExists("a", 5)
  14. jm.SetIfNoExists("b", 6)
  15. log.Println(jm.GetAndDel("b"))
  16. log.Println(jm)
  17. }