Skip to content

Commit 862cc43

Browse files
author
Alessio Treglia
committed
Fix tests
1 parent 71ca0e5 commit 862cc43

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

types/coin_test.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,7 @@ func TestCoins(t *testing.T) {
276276
mixedCase3 := Coins{
277277
{"gAs", NewInt(1)},
278278
}
279-
empty := Coins{
280-
{"gold", NewInt(0)},
281-
}
282-
null := Coins{}
279+
empty := NewCoins()
283280
badSort1 := Coins{
284281
{"tree", NewInt(1)},
285282
{"gas", NewInt(1)},
@@ -312,7 +309,7 @@ func TestCoins(t *testing.T) {
312309
assert.False(t, mixedCase2.IsValid(), "First Coins denoms contain upper case characters")
313310
assert.False(t, mixedCase3.IsValid(), "Single denom in Coins contains upper case characters")
314311
assert.True(t, good.IsAllPositive(), "Expected coins to be positive: %v", good)
315-
assert.False(t, null.IsAllPositive(), "Expected coins to not be positive: %v", null)
312+
assert.False(t, empty.IsAllPositive(), "Expected coins to not be positive: %v", empty)
316313
assert.True(t, good.IsAllGTE(empty), "Expected %v to be >= %v", good, empty)
317314
assert.False(t, good.IsAllLT(empty), "Expected %v to be < %v", good, empty)
318315
assert.True(t, empty.IsAllLT(good), "Expected %v to be < %v", empty, good)
@@ -331,7 +328,7 @@ func TestCoinsGT(t *testing.T) {
331328
assert.True(t, Coins{{testDenom1, one}}.IsAllGT(Coins{}))
332329
assert.False(t, Coins{{testDenom1, one}}.IsAllGT(Coins{{testDenom1, one}}))
333330
assert.False(t, Coins{{testDenom1, one}}.IsAllGT(Coins{{testDenom2, one}}))
334-
assert.True(t, Coins{{testDenom1, one}, {testDenom2, one}}.IsAllGT(Coins{{testDenom2, one}}))
331+
assert.True(t, Coins{{testDenom1, one}, {testDenom2, two}}.IsAllGT(Coins{{testDenom2, one}}))
335332
assert.False(t, Coins{{testDenom1, one}, {testDenom2, one}}.IsAllGT(Coins{{testDenom2, two}}))
336333
}
337334

@@ -358,7 +355,7 @@ func TestCoinsLT(t *testing.T) {
358355
assert.False(t, Coins{{testDenom1, one}, {testDenom2, one}}.IsAllLT(Coins{{testDenom2, one}}))
359356
assert.False(t, Coins{{testDenom1, one}, {testDenom2, one}}.IsAllLT(Coins{{testDenom2, two}}))
360357
assert.False(t, Coins{{testDenom1, one}, {testDenom2, one}}.IsAllLT(Coins{{testDenom1, one}, {testDenom2, one}}))
361-
assert.True(t, Coins{{testDenom1, one}, {testDenom2, one}}.IsAllLT(Coins{{testDenom1, one}, {testDenom2, two}}))
358+
assert.True(t, Coins{{testDenom1, one}, {testDenom2, one}}.IsAllLT(Coins{{testDenom1, two}, {testDenom2, two}}))
362359
assert.True(t, Coins{}.IsAllLT(Coins{{testDenom1, one}}))
363360
}
364361

0 commit comments

Comments
 (0)