| 1 | package execution_test |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/tomwright/dasel/v3/model" |
| 7 | ) |
| 8 | |
| 9 | func TestFuncMax(t *testing.T) { |
| 10 | t.Run("int", testCase{ |
| 11 | s: `max(1, 2, 3)`, |
| 12 | out: model.NewIntValue(3), |
| 13 | }.run) |
| 14 | t.Run("float", testCase{ |
| 15 | s: `max(1f, 2.5, 3.5)`, |
| 16 | out: model.NewFloatValue(3.5), |
| 17 | }.run) |
| 18 | t.Run("mixed", testCase{ |
| 19 | s: `max(1, 2f)`, |
| 20 | out: model.NewFloatValue(2), |
| 21 | }.run) |
| 22 | } |