-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_vce_test.go
More file actions
57 lines (48 loc) · 1.41 KB
/
check_vce_test.go
File metadata and controls
57 lines (48 loc) · 1.41 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
57
package done
import (
"testing"
)
// TestVE tests the VCE function creates a Vce instance.
// TestVE 测试 VCE 函数创建 Vce 实例。
func TestVE(t *testing.T) {
ve := VCE(newExample())
t.Log(ve.V)
}
// TestVe_Done tests the Done method checks error and returns value.
// TestVe_Done 测试 Done 方法检查错误并返回值。
func TestVe_Done(t *testing.T) {
example := VCE(newExample()).Done()
t.Log(example.S)
}
// TestVe_Good tests the Good method ensures value is not zero.
// TestVe_Good 测试 Good 方法确保值非零。
func TestVe_Good(t *testing.T) {
VCE(newExample()).Good()
}
// TestVe_Nice tests the Nice method ensures value is not zero and returns it.
// TestVe_Nice 测试 Nice 方法确保值非零并返回值。
func TestVe_Nice(t *testing.T) {
example := VCE(newExample()).Nice()
t.Log(example.S)
}
// TestVe_Zero tests the Zero method ensures value is zero.
// TestVe_Zero 测试 Zero 方法确保值是零值。
func TestVe_Zero(t *testing.T) {
VCE(newFalse()).Zero()
VCE(newInt64(0)).Zero()
}
// newFalse returns false boolean value.
// newFalse 返回 false 布尔值。
func newFalse() (bool, error) {
return false, nil
}
// newInt64 returns an int64 value.
// newInt64 返回一个 int64 值。
func newInt64(v int64) (int64, error) {
return v, nil
}
// newUint64 returns an uint64 value.
// newUint64 返回一个 uint64 值。
func newUint64(v uint64) (uint64, error) {
return v, nil
}