|
|
package chance
|
|
|
|
|
|
import (
|
|
|
"opp/protocol"
|
|
|
"testing"
|
|
|
)
|
|
|
|
|
|
type A []int
|
|
|
|
|
|
func (a A) Change() {
|
|
|
if len(a) == 0 {
|
|
|
return
|
|
|
}
|
|
|
a[0] = 5
|
|
|
}
|
|
|
|
|
|
func TestArrayStruct(t *testing.T) {
|
|
|
var a = A([]int{1, 2})
|
|
|
//a.Change()
|
|
|
|
|
|
var b = a
|
|
|
b.Change()
|
|
|
t.Log(a)
|
|
|
}
|
|
|
|
|
|
func TestSelfChecks(t *testing.T) {
|
|
|
var selfs = []protocol.SelfCheck{
|
|
|
{
|
|
|
GroupId: 1,
|
|
|
CheckItem: "1",
|
|
|
},
|
|
|
{
|
|
|
GroupId: 1,
|
|
|
Answer: "否",
|
|
|
},
|
|
|
{
|
|
|
GroupId: 1,
|
|
|
Answer: "是",
|
|
|
},
|
|
|
{
|
|
|
GroupId: 1,
|
|
|
Answer: "不清楚",
|
|
|
},
|
|
|
{
|
|
|
GroupId: 2,
|
|
|
CheckItem: "2",
|
|
|
},
|
|
|
{
|
|
|
GroupId: 2,
|
|
|
Answer: "否",
|
|
|
},
|
|
|
{
|
|
|
GroupId: 2,
|
|
|
Answer: "否",
|
|
|
},
|
|
|
{
|
|
|
GroupId: 2,
|
|
|
Answer: "不清楚",
|
|
|
},
|
|
|
}
|
|
|
var s = protocol.SelfChecks(selfs)
|
|
|
s.SetSelfChecksLevel1ByRule()
|
|
|
t.Log(s[0], s[4])
|
|
|
} |
...
|
...
|
|