Skip to content

Commit

Permalink
xdr: Add ScVal Equals() coverage unit test (#4812)
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio authored Mar 16, 2023
1 parent cd3a221 commit 0fbbda4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions xdr/scval_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package xdr

import (
"testing"

"github.com/stretchr/testify/assert"

"github.com/stellar/go/gxdr"
"github.com/stellar/go/randxdr"
)

func TestScValEqualsCoverage(t *testing.T) {
gen := randxdr.NewGenerator()
for i := 0; i < 30000; i++ {
scVal := ScVal{}

shape := &gxdr.SCVal{}
gen.Next(
shape,
[]randxdr.Preset{},
)
assert.NoError(t, gxdr.Convert(shape, &scVal))

clonedScVal := ScVal{}
assert.NoError(t, gxdr.Convert(shape, &clonedScVal))
assert.True(t, scVal.Equals(clonedScVal))
}
}

0 comments on commit 0fbbda4

Please sign in to comment.