-
Notifications
You must be signed in to change notification settings - Fork 0
/
scan_test.go
48 lines (38 loc) · 840 Bytes
/
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
package main
import (
"fmt"
"io/ioutil"
"strings"
"testing"
)
// TestParseResult tests the __ function.
func TestParseResult(t *testing.T) {
r, err := ioutil.ReadFile("tests/av_scan.out")
if err != nil {
fmt.Print(err)
}
result := strings.Split(string(r), "\t")
if !strings.Contains(string(r), "[OK]") {
if true {
t.Log("Infected: ", true)
t.Log("Result: ", strings.TrimSpace(result[1]))
}
}
}
// TestParseVersion tests the __ function.
func TestParseVersion(t *testing.T) {
v, err := ioutil.ReadFile("tests/av_version.out")
if err != nil {
fmt.Print(err)
}
d, err := ioutil.ReadFile("tests/av_vps.out")
if err != nil {
fmt.Print(err)
}
version := strings.TrimSpace(string(v))
database := strings.TrimSpace(string(d))
if true {
t.Log("version: ", version)
t.Log("database: ", database)
}
}