-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdict_test.go
More file actions
59 lines (52 loc) · 932 Bytes
/
dict_test.go
File metadata and controls
59 lines (52 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package pythonlikego
import (
"fmt"
"os"
"testing"
)
var (
ma Dict
)
func init() {
ma = NewDict()
ma["hoge"] = "hage"
ma["fifi"] = "fasjfa"
}
func TestMain(m *testing.M) {
code := m.Run()
fmt.Println(ma)
os.Exit(code)
}
func TestMapLength(t *testing.T) {
length := ma.Length()
fmt.Println(length)
}
func TestMapKeys(t *testing.T) {
keys := ma.Keys()
fmt.Println(keys)
}
func TestMapIsKeyExist(t *testing.T) {
exist := ma.IsKeyExist("hoge")
fmt.Println(exist)
}
func TestMapGet(t *testing.T) {
get := ma.Get("fasdfa", nil)
fmt.Println(get)
}
func TestMapPop(t *testing.T) {
pop := ma.Pop("hoge", nil)
fmt.Println(pop)
}
func TestMapPopItem(t *testing.T) {
item, i := ma.PopItem()
fmt.Println(item, i)
}
func TestMapSetDefault(t *testing.T) {
ma.SetDefault("kasu", Dict{"hi": "f"})
}
func TestMapUpdate(t *testing.T) {
ma.Update(Dict{"test": "gogo"})
}
func TestMapValues(t *testing.T) {
ma.Values()
}