Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Add UsingCorrespondence.doesNotContain for iterables and doesNotContainEntry for maps and multimaps. 2. Improve the grammatical correctness of failure messages. BEFORE: Correspondence.toString() was expected to be written for a plural subject (e.g. "are finite numbers within 0.00001 of") and this played badly with situations where the subject is singular — in particular, in maps where by definition there's only one value per key, and in particularly particular there was one failure message which would have read "but the value is <2.71828> which does not are finite numbers within 0.00001 <3.14159>". (I hadn't noticed this until now because it didn't show up in the example used in the tests.) AFTER: Correspondence.toString() was expected to be written for a singular subject (e.g. "is a finite number within 0.00001 of"). After spending ages playing with these things, I've concluded that it's easier to phrase the statements so that they always refer to a singular subject (if we have a collection we can refer to "each element") than that they always refer to a plural subject. (I don't really want to have two methods on Correspondence, one for each case, and require implementers to have to think about this grammar stuff.) 3. Minor: Make the failure messages in the tests easier to understand by putting a + sign in front of each string-which-parses-as-an-integer, so that we can tell the difference between the string "+456" and the integer 456. (Although StringSubject quotes strings for display, IterableSubject et al do not. Perhaps they should: that's a separate question...) 4. Very minor: Fix up some more which/that errors. I know this isn't really the end of the world, but once I'd started picking at it I kinda wanted to be consistent. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130520851
- Loading branch information
Showing
10 changed files
with
241 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.