(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func TestValue_GoValue(t *testing.T) { |
| 29 | t.Run("null", goValueTestCase{ |
| 30 | in: model.NewNullValue(), |
| 31 | exp: nil, |
| 32 | }.run) |
| 33 | t.Run("int", goValueTestCase{ |
| 34 | in: model.NewIntValue(42), |
| 35 | exp: int64(42), |
| 36 | }.run) |
| 37 | t.Run("float", goValueTestCase{ |
| 38 | in: model.NewFloatValue(3.14), |
| 39 | exp: 3.14, |
| 40 | }.run) |
| 41 | t.Run("string", goValueTestCase{ |
| 42 | in: model.NewStringValue("hello"), |
| 43 | exp: "hello", |
| 44 | }.run) |
| 45 | t.Run("bool", goValueTestCase{ |
| 46 | in: model.NewBoolValue(true), |
| 47 | exp: true, |
| 48 | }.run) |
| 49 | t.Run("slice", goValueTestCase{ |
| 50 | inFn: func() *model.Value { |
| 51 | s := model.NewSliceValue() |
| 52 | _ = s.Append(model.NewIntValue(1)) |
| 53 | _ = s.Append(model.NewIntValue(2)) |
| 54 | _ = s.Append(model.NewIntValue(3)) |
| 55 | return s |
| 56 | }, |
| 57 | exp: []any{int64(1), int64(2), int64(3)}, |
| 58 | }.run) |
| 59 | t.Run("map", goValueTestCase{ |
| 60 | inFn: func() *model.Value { |
| 61 | m := model.NewMapValue() |
| 62 | _ = m.SetMapKey("a", model.NewStringValue("apple")) |
| 63 | return m |
| 64 | }, |
| 65 | exp: map[string]any{ |
| 66 | "a": "apple", |
| 67 | }, |
| 68 | }.run) |
| 69 | } |
nothing calls this directly
no test coverage detected