list_test.go 260 B

1234567891011121314151617
  1. package hashmap
  2. import "testing"
  3. func TestListNew(t *testing.T) {
  4. l := NewList()
  5. n := l.First()
  6. if n != nil {
  7. t.Error("First item of list should be nil.")
  8. }
  9. n = l.head.Next()
  10. if n != nil {
  11. t.Error("Next element of empty list should be nil.")
  12. }
  13. }