-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathscan_test.go
85 lines (68 loc) · 1.66 KB
/
scan_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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package main
import (
"fmt"
"io/ioutil"
"testing"
)
// TestParseExiftool tests the ParseExiftoolOutput function.
func TestParseExiftool(t *testing.T) {
b, err := ioutil.ReadFile("test/exiftool.out")
if err != nil {
fmt.Print(err)
}
results := ParseExiftoolOutput(string(b), nil)
if err != nil {
t.Log(err)
}
if true {
t.Log("results: ", results)
}
}
// TestParseTRiD tests the ParseTRiDOutput function.
func TestParseTRiD(t *testing.T) {
b, err := ioutil.ReadFile("test/trid.out") // just pass the file name
if err != nil {
fmt.Print(err)
}
trid := ParseTRiDOutput(string(b), nil)
if true {
t.Log("trid: ", trid)
}
}
// TestParseTRiDSsdeep tests the ParseSsdeepOutput function.
func TestParseTRiDSsdeep(t *testing.T) {
b, err := ioutil.ReadFile("test/ssdeep.out") // just pass the file name
if err != nil {
fmt.Print(err)
}
ssdeep := ParseSsdeepOutput(string(b), nil)
if true {
t.Log("ssdeep: ", ssdeep)
}
}
// TestGenerateMarkDownTable tests the ParseSsdeepOutput function.
func TestGenerateMarkDownTable(t *testing.T) {
exifOut, err := ioutil.ReadFile("test/exiftool.out")
if err != nil {
fmt.Print(err)
}
tridOut, err := ioutil.ReadFile("test/trid.out")
if err != nil {
fmt.Print(err)
}
ssdeepOut, err := ioutil.ReadFile("test/ssdeep.out")
if err != nil {
fmt.Print(err)
}
fileInfo := FileInfo{
// Magic: fi.Magic,
SSDeep: ParseSsdeepOutput(string(ssdeepOut), nil),
TRiD: ParseTRiDOutput(string(tridOut), nil),
Exiftool: ParseExiftoolOutput(string(exifOut), nil),
}
fileInfo.MarkDown = generateMarkDownTable(fileInfo)
markDown := generateMarkDownTable(fileInfo)
if true {
t.Log("markDown: ", markDown)
}
}