Skip to content

Commit

Permalink
Move around
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Oct 29, 2024
1 parent a4a2b5d commit ec5f918
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions libs/dyn/jsonsaver/encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
assert "github.com/databricks/cli/libs/dyn/dynassert"
)

func TestEncoder_marshalNoEscape(t *testing.T) {
func TestEncoder_MarshalNoEscape(t *testing.T) {
out, err := marshalNoEscape("1 < 2")
if !assert.NoError(t, err) {
return
Expand All @@ -22,7 +22,7 @@ func TestEncoder_marshalNoEscape(t *testing.T) {
assert.Contains(t, string(out), "\n")
}

func TestEncoder_marshalIndentNoEscape(t *testing.T) {
func TestEncoder_MarshalIndentNoEscape(t *testing.T) {
out, err := marshalIndentNoEscape([]string{"1 < 2", "2 < 3"}, "", " ")
if !assert.NoError(t, err) {
return
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ import (
assert "github.com/databricks/cli/libs/dyn/dynassert"
)

func TestMarshalString(t *testing.T) {
func TestMarshal_String(t *testing.T) {
b, err := Marshal(dyn.V("string"))
if assert.NoError(t, err) {
assert.JSONEq(t, `"string"`, string(b))
}
}

func TestMarshalBool(t *testing.T) {
func TestMarshal_Bool(t *testing.T) {
b, err := Marshal(dyn.V(true))
if assert.NoError(t, err) {
assert.JSONEq(t, `true`, string(b))
}
}

func TestMarshalInt(t *testing.T) {
func TestMarshal_Int(t *testing.T) {
b, err := Marshal(dyn.V(42))
if assert.NoError(t, err) {
assert.JSONEq(t, `42`, string(b))
}
}

func TestMarshalFloat(t *testing.T) {
func TestMarshal_Float(t *testing.T) {
b, err := Marshal(dyn.V(42.1))
if assert.NoError(t, err) {
assert.JSONEq(t, `42.1`, string(b))
}
}

func TestMarshalTime(t *testing.T) {
func TestMarshal_Time(t *testing.T) {
b, err := Marshal(dyn.V(dyn.MustTime("2021-01-01T00:00:00Z")))
if assert.NoError(t, err) {
assert.JSONEq(t, `"2021-01-01T00:00:00Z"`, string(b))
}
}

func TestMarshalMap(t *testing.T) {
func TestMarshal_Map(t *testing.T) {
m := dyn.NewMapping()
m.Set(dyn.V("key1"), dyn.V("value1"))
m.Set(dyn.V("key2"), dyn.V("value2"))
Expand All @@ -53,7 +53,7 @@ func TestMarshalMap(t *testing.T) {
}
}

func TestMarshalSequence(t *testing.T) {
func TestMarshal_Sequence(t *testing.T) {
var s []dyn.Value
s = append(s, dyn.V("value1"))
s = append(s, dyn.V("value2"))
Expand All @@ -64,7 +64,7 @@ func TestMarshalSequence(t *testing.T) {
}
}

func TestMarshalComplex(t *testing.T) {
func TestMarshal_Complex(t *testing.T) {
map1 := dyn.NewMapping()
map1.Set(dyn.V("str1"), dyn.V("value1"))
map1.Set(dyn.V("str2"), dyn.V("value2"))
Expand Down

0 comments on commit ec5f918

Please sign in to comment.