Add implementation of equals/hashCode laws

Đang mở
#8 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
scala
Lĩnh vực
testing

Hướng nghiên cứu

Start by reviewing the requested AnyRefLaws example and the referenced alasc implementation. Identify how discipline represents law implementations, then define the behavior around makeClone and the two distinct instances. Done means an AnyRefLaws implementation checks the default equals/hashCode laws and has coverage for the stated cases.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

As a working example, discipline could provide an "AnyRefLaws" implementation that checks the behavior of the default equals and hashCode methods.

In particular, the implementation could work from:

  • a makeClone method that creates a deep copy of an instance,
  • two particular instances that are guaranteed to compare as != with differing hashCode.

See for example: https://github.com/denisrosset/alasc/blob/master/scalacheck-binding/src/main/scala/net.alasc/laws/AnyRefLaws.scala

I'd gladly provide a PR if there is interest.

Ngôn ngữ chính
Scala
Star
338
Fork
60
Merge trung bình
5 giờ 22 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của typelevel/discipline

Tất cả issue của typelevel/discipline

Issue tương tự

Thêm issue về Scala

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.