增加单元测试文件
This commit is contained in:
25
system/cpu_test.go
Normal file
25
system/cpu_test.go
Normal file
@ -0,0 +1,25 @@
|
||||
// Package system...
|
||||
//
|
||||
// Description : system...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-10-12 5:58 下午
|
||||
package system
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestGetCPUInfo ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 5:58 下午 2021/10/12
|
||||
func TestGetCPUInfo(t *testing.T) {
|
||||
r, _ := GetCPUInfo()
|
||||
byteData, _ := json.Marshal(r)
|
||||
fmt.Println(string(byteData))
|
||||
}
|
25
system/disk_test.go
Normal file
25
system/disk_test.go
Normal file
@ -0,0 +1,25 @@
|
||||
// Package system...
|
||||
//
|
||||
// Description : system...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-10-12 9:04 下午
|
||||
package system
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestGetDiskInfo ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 9:04 下午 2021/10/12
|
||||
func TestGetDiskInfo(t *testing.T) {
|
||||
r, _ := GetDiskInfo()
|
||||
byteData, _ := json.Marshal(r)
|
||||
fmt.Println(string(byteData))
|
||||
}
|
25
system/host_test.go
Normal file
25
system/host_test.go
Normal file
@ -0,0 +1,25 @@
|
||||
// Package system...
|
||||
//
|
||||
// Description : system...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-10-12 7:58 下午
|
||||
package system
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestGetHostInfo ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 7:59 下午 2021/10/12
|
||||
func TestGetHostInfo(t *testing.T) {
|
||||
r, _ := GetHostInfo()
|
||||
byteData, _ := json.Marshal(r)
|
||||
fmt.Println(string(byteData))
|
||||
}
|
25
system/memory_test.go
Normal file
25
system/memory_test.go
Normal file
@ -0,0 +1,25 @@
|
||||
// Package system...
|
||||
//
|
||||
// Description : system...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2021-10-12 7:09 下午
|
||||
package system
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// TestGetMemoryInfo ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 7:09 下午 2021/10/12
|
||||
func TestGetMemoryInfo(t *testing.T) {
|
||||
r, _ := GetMemoryInfo()
|
||||
byteData, _ := json.Marshal(r)
|
||||
fmt.Println(string(byteData))
|
||||
}
|
Reference in New Issue
Block a user