Opened 6 years ago
Closed 6 years ago
#8543 closed defect (fixed)
EmptySet is Back ! TestSuite should allows for empty sets.
Reported by: | hivert | Owned by: | hivert |
---|---|---|---|
Priority: | major | Milestone: | sage-4.4 |
Component: | categories | Keywords: | empty set, Testsuite, EmptySetError |
Cc: | nborie, sage-combinat | Merged in: | sage-4.4.alpha0 |
Authors: | Florent Hivert | Reviewers: | Nicolas Borie, Nicolas M. Thiéry |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by hivert)
There is currently no way to have an empty set which pass the category tests. Indeed the current specification says: for any set S there must be a method S.an_element() which returns an actual element x such that x in S:
an_element = self.an_element() tester.assert_(an_element in self, "self.an_element() is not in self")
This tests should allows S to be empty.
To solve this issue I added a new exception called EmptySetError which should be raised in such cases. I fixed the tests suite of the category Sets() accordingly and expanded the test in some places where this could be done before.
Depends on #8519
Attachments (2)
Change History (10)
Changed 6 years ago by hivert
comment:1 Changed 6 years ago by hivert
- Description modified (diff)
- Keywords EmptySetError added
- Status changed from new to needs_review
- Summary changed from EmptySet is Back ! to EmptySet is Back ! TestSuite should allows for empty sets.
comment:2 Changed 6 years ago by nborie
- Reviewers set to Nicolas Borie
- Status changed from needs_review to positive_review
comment:3 Changed 6 years ago by nthiery
- Status changed from positive_review to needs_work
Nicolas: thanks for your review!
Florent: I made a quick reviewer patch fixing some trivial things. Please double check, and set back the positive review!
Changed 6 years ago by nthiery
comment:4 Changed 6 years ago by nthiery
- Status changed from needs_work to needs_review
comment:5 Changed 6 years ago by nthiery
- Cc sage-combinat added
comment:6 Changed 6 years ago by nthiery
- Reviewers changed from Nicolas Borie to Nicolas Borie, Nicolas M. Thiéry
comment:7 Changed 6 years ago by hivert
- Status changed from needs_review to positive_review
The new changes are good to me => positive review.
comment:8 Changed 6 years ago by jhpalmieri
- Merged in set to sage-4.4.alpha0
- Resolution set to fixed
- Status changed from positive_review to closed
Merged in 4.4.alpha0:
- trac_8543-empty_set_categories-fh.patch
- trac_8543-empty_set_categories-review-nt.patch
Patches from #8519 your patch apply fine on 4.3.4
All tests passed for each touched files, doc is OK too. This another empty problem is fixed...
Thanks for fixing this!
I give this patch a positive review...