test First()
All checks were successful
Go / test (push) Successful in 4s

This commit is contained in:
Adam Jeniski 2025-11-04 17:19:45 -10:00
parent f5f7691de0
commit cfbddb3f39

View File

@ -71,3 +71,10 @@ func TestRestDecreasesLengthForNonEmptyList(t *testing.T) {
assert.Equal(t, myList.Len()-1, myList.Rest().Len())
})
}
func TestFirstIsNilWhenEmpty(t *testing.T) {
rapid.Check(t, func(t *rapid.T) {
myList := intListGen().Draw(t, "myList")
assert.Equal(t, myList.IsEmpty(), myList.First() == nil)
})
}