(t *testing.T)
| 112 | } |
| 113 | |
| 114 | func TestModel_AddDef(t *testing.T) { |
| 115 | m := NewModel() |
| 116 | s := "r" |
| 117 | v := "sub, obj, act" |
| 118 | ok := m.AddDef(s, s, v) |
| 119 | if !ok { |
| 120 | t.Errorf("non empty assertion should be added") |
| 121 | } |
| 122 | ok = m.AddDef(s, s, "") |
| 123 | if ok { |
| 124 | t.Errorf("empty assertion value should not be added") |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | func TestModelToTest(t *testing.T) { |
| 129 | testModelToText(t, "r.sub == p.sub && r.obj == p.obj && r_func(r.act, p.act) && testr_func(r.act, p.act)", "r_sub == p_sub && r_obj == p_obj && r_func(r_act, p_act) && testr_func(r_act, p_act)") |