1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- package identify
- import (
- "testing"
- )
- func TestNewMultiCheck(t *testing.T) {
- //map[string]MultiRule{}
- // ``
- ruleString := `{"过滤初期":{"C.M.UF1_DB@word_control":{"NvIn":["26"]},"C.M.UF1_DB@time_production":{"NvIn":["$C.M.UF1_DB@time_sp-360...$C.M.UF1_DB@time_sp-60"]},"C.M.UF1_DB@time_sp":{}}}`
- ovs := map[string]string{
- "C.M.UF1_DB@word_control": "25",
- "C.M.UF1_DB@time_production": "361",
- "C.M.UF1_DB@time_sp": "4500",
- }
- nvs := map[string]string{
- "C.M.UF1_DB@word_control": "26",
- "C.M.UF1_DB@time_production": "8839",
- "C.M.UF1_DB@time_sp": "9000",
- }
- eventName := MultiTest(ovs, nvs, ruleString)
- t.Log(eventName)
- }
- func TestNewMultiCheck1(t *testing.T) {
- //map[string]MultiRule{}
- // ``
- //ruleString := `{"过滤初期":{"C.M.UF1_DB@word_control":{"NvIn":["26"]},"C.M.UF1_DB@time_production":{"NvIn":["$C.M.UF1_DB@time_sp-360...$C.M.UF1_DB@time_sp-60"]},"C.M.UF1_DB@time_sp":{}}}`
- ruleString := `{"xxx":{"C.M.UF4_DB@word_control":{},"C.M.UF4_DB@time_production_display":{},"C.M.UF4_DB@time_production":{},"C.M.UF4_DB@cycle_out":{"NvIn":["0"],"OvIn":["$C.M.UF4_DB@cycle_sp-1"]},"C.M.UF4_DB@cycle_sp":{}}}`
- ovs := map[string]string{
- "C.M.UF4_DB@word_control": "25",
- "C.M.UF4_DB@time_production": "361",
- "C.M.UF4_DB@time_production_display": "9632",
- "C.M.UF4_DB@time_sp": "4500",
- "C.M.UF4_DB@cycle_out": "29",
- "C.M.UF4_DB@cycle_sp": "30",
- }
- nvs := map[string]string{
- "C.M.UF4_DB@word_control": "26",
- "C.M.UF4_DB@time_production_display": "9632",
- "C.M.UF4_DB@time_production": "8839",
- "C.M.UF4_DB@time_sp": "9000",
- "C.M.UF4_DB@cycle_out": "0",
- "C.M.UF4_DB@cycle_sp": "33",
- }
- eventName := MultiTest(ovs, nvs, ruleString)
- t.Log(eventName)
- }
- func TestNewMultiCheck2(t *testing.T) {
- x := map[string]interface{}{
- "x": 1,
- "xb": "b",
- "asdf": nil,
- }
- for s, i := range x {
- t.Logf("name: %s %#v\n", s, i)
- }
- }
|