-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentity_test.go
More file actions
56 lines (49 loc) · 1.11 KB
/
entity_test.go
File metadata and controls
56 lines (49 loc) · 1.11 KB
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
package kspa
import (
"io/ioutil"
"os"
"testing"
)
func TestGenerateRandomEntitiesJson(t *testing.T) {
type args struct {
path string
count int
removeOld bool
c RandomEntitySeqInfo
}
teardownTestCase := setupTestCase(t)
defer teardownTestCase(t)
tests := []struct {
name string
args args
}{
{
name: "generate_data_for_benchmark",
args: args{
path: "./examples/v5000_e20000",
count: 10,
removeOld: true,
c: RandomEntitySeqInfo{
VertexCount: 5000,
VertexStdFactor: 50,
EdgesCount: 20000,
RelationMin: 0.0,
RelationMax: 100000.0,
NoiseMean: 0.0,
NoiseStdDev: 0.0001,
},
},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
GenerateRandomEntitiesJson(tt.args.path, tt.args.count, tt.args.removeOld, tt.args.c)
files, _ := ioutil.ReadDir(tt.args.path)
filesCount := len(files)
if tt.args.count != filesCount {
t.Errorf("Dfs.GenerateRandomEntitiesJson() create %v files, want %v", filesCount, tt.args.count)
}
os.RemoveAll(tt.args.path)
})
}
}