| 1 | package execution_test |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/tomwright/dasel/v3/model" |
| 7 | ) |
| 8 | |
| 9 | func TestFuncToLower(t *testing.T) { |
| 10 | t.Run("chained input", testCase{ |
| 11 | s: `"Hello World".toLower()`, |
| 12 | out: model.NewStringValue("hello world"), |
| 13 | }.run) |
| 14 | t.Run("arg input", testCase{ |
| 15 | s: `toLower("Hello World")`, |
| 16 | out: model.NewStringValue("hello world"), |
| 17 | }.run) |
| 18 | t.Run("already lowercase", testCase{ |
| 19 | s: `"abc".toLower()`, |
| 20 | out: model.NewStringValue("abc"), |
| 21 | }.run) |
| 22 | t.Run("all uppercase", testCase{ |
| 23 | s: `"ABC".toLower()`, |
| 24 | out: model.NewStringValue("abc"), |
| 25 | }.run) |
| 26 | } |