Skip to content

Commit

Permalink
test: Add MaxFractionalAmount() test to ensure pointers are different
Browse files Browse the repository at this point in the history
  • Loading branch information
drklee3 committed May 10, 2024
1 parent 93419bb commit 66c307f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x/precisebank/types/fractional_balance_test.go
Expand Up @@ -33,6 +33,14 @@ func TestMaxFractionalAmount_Immutable(t *testing.T) {
)
}

func TestMaxFractionalAmount_Copied(t *testing.T) {
max1 := types.MaxFractionalAmount().BigIntMut()
max2 := types.MaxFractionalAmount().BigIntMut()

// Checks that the returned two pointers do not reference the same object
require.NotSame(t, max1, max2, "max fractional amount should be copied")
}

func TestNewFractionalBalance(t *testing.T) {
tests := []struct {
name string
Expand Down

0 comments on commit 66c307f

Please sign in to comment.