This commit is contained in:
parent
6155074b77
commit
b7b7f79559
@ -29,12 +29,14 @@ func TestConjIncreasesLength(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestRestDecreasesLengthForNonEmptyList(t *testing.T) {
|
||||
func TestRestDecreasesLength(t *testing.T) {
|
||||
rapid.Check(t, func(t *rapid.T) {
|
||||
myList := intListGen().Filter(func(l IList) bool {
|
||||
return !l.IsEmpty()
|
||||
}).Draw(t, "myList")
|
||||
assert.Equal(t, myList.Len()-1, myList.Rest().Len())
|
||||
myList := intListGen().Draw(t, "myList")
|
||||
if myList.IsEmpty() {
|
||||
assert.Equal(t, 0, myList.Rest().Len())
|
||||
} else {
|
||||
assert.Equal(t, myList.Len()-1, myList.Rest().Len())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user