-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonitor_test.go
62 lines (59 loc) · 1.32 KB
/
monitor_test.go
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
60
61
62
/*
Copyright © 2019, 2022 M.Watermann, 10247 Berlin, Germany
All rights reserved
EMail : <support@mwat.de>
*/
package sessions
import (
"path/filepath"
"testing"
"time"
)
func Test_goStore(t *testing.T) {
sdir, _ := filepath.Abs("./sessions")
sid := newSID()
list := make(tSessionData)
list["Zeichenkette"] = "eine Zeichenkette"
list["Zahl"] = 123456789
list["Datum"] = time.Now()
type args struct {
aSessionDir string
aSID string
aData tSessionData
}
tests := []struct {
name string
args args
}{
// TODO: Add test cases.
{" 1", args{sdir, sid, list}},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
goStore(tt.args.aSessionDir, tt.args.aSID, &tt.args.aData)
})
}
} // Test_goStore()
func Test_loadSession(t *testing.T) {
sdir, _ := filepath.Abs("./sessions")
sid := initTestSession()
type args struct {
aSessionDir string
aSID string
}
tests := []struct {
name string
args args
want int //*tSessionData
}{
// TODO: Add test cases.
{" 1", args{sdir, sid}, 5},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := loadSession(tt.args.aSessionDir, tt.args.aSID); len(*got) != tt.want {
t.Errorf("loadSession() = %v, want %v", len(*got), tt.want)
}
})
}
} // Test_loadSession()