Skip to content

Commit

Permalink
add test for resetting field values
Browse files Browse the repository at this point in the history
  • Loading branch information
alovak committed Oct 25, 2024
1 parent 3f9cf01 commit 031a247
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,10 @@ func TestMessage(t *testing.T) {

// reset the fields
err = clone.Marshal(&struct {
F2 *string `iso8583:"2,keepzero"`
F2 *field.String `iso8583:",keepzero"`
F3 *struct {
F2 *string `iso8583:"2,keepzero"`
} `iso8583:"3,keepzero"`
F2 *field.String `iso8583:",keepzero"`
} `iso8583:",keepzero"`
}{})
require.NoError(t, err)

Expand Down Expand Up @@ -1765,7 +1765,7 @@ func TestMessageClone(t *testing.T) {
// check if the PAN is reset
require.Equal(t, "", responseData.F2.Value())
// check if the F55.F9A is reset
require.Equal(t, "210720", responseData.F55.F9A.Value())
require.Equal(t, "", responseData.F55.F9A.Value())
}

func TestMessageMarshaling(t *testing.T) {
Expand Down

0 comments on commit 031a247

Please sign in to comment.