Debian Codegraph @

execution/func_to_upper_test.go

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