(t *testing.T)
| 122 | } |
| 123 | |
| 124 | func TestValue_Modulo(t *testing.T) { |
| 125 | run := func(a, b *model.Value, exp *model.Value) func(*testing.T) { |
| 126 | return func(t *testing.T) { |
| 127 | got, err := a.Modulo(b) |
| 128 | if err != nil { |
| 129 | t.Errorf("unexpected error: %s", err) |
| 130 | return |
| 131 | } |
| 132 | eq, err := got.EqualTypeValue(exp) |
| 133 | if err != nil { |
| 134 | t.Errorf("unexpected error: %s", err) |
| 135 | return |
| 136 | } |
| 137 | if !eq { |
| 138 | t.Errorf("expected %v, got %v", exp, got) |
| 139 | } |
| 140 | } |
| 141 | } |
| 142 | t.Run("int", func(t *testing.T) { |
| 143 | t.Run("int", run(model.NewIntValue(10), model.NewIntValue(3), model.NewIntValue(1))) |
| 144 | t.Run("float", run(model.NewIntValue(10), model.NewFloatValue(3), model.NewFloatValue(1))) |
| 145 | }) |
| 146 | t.Run("float", func(t *testing.T) { |
| 147 | t.Run("int", run(model.NewFloatValue(10), model.NewIntValue(3), model.NewFloatValue(1))) |
| 148 | t.Run("float", run(model.NewFloatValue(10), model.NewFloatValue(3), model.NewFloatValue(1))) |
| 149 | }) |
| 150 | } |
nothing calls this directly
no test coverage detected