-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove 2 special cases for printing arrays:
1. Remove the type name from the output: Not true that <(Object[]) [A, 5]> is empty => Not true that <[A, 5]> is empty Rationale: We don't include type names for Iterables (though of course that's in part because we would have to guess in some cases), and no one seems to mind. Similarly, when we introduced types like ImmutableIntArray, we didn't seem to think it was important to include there. Note that we still display the types in case of type mismatch (at least in most cases -- I'm not sure about nested array mismatches offhand, but there's not always a good way to represent such types, anyway). 2. Make named() supplement the existing actual value text, not replace it. Not true that foo has length <1> => Not true that foo (<[A, 5]>) has length <1> Rationale: This is how named() behaves for normal types. The current behavior has been there since Truth was imported into [], so I don't know of any particular requests for it to be this way. My best guess is that it's intended to avoid "Not true that <... extremely long array ...> is...," most checks are probably going to be isEqualTo() checks, so we're going to end up with an extremely long array in the message, anyway, for the expected value. I suppose that abbreviation could help somewhat with length checks, but if someone really needs to avoid printing the value, I'd suggest `assertThat(array.length).isEqualTo(...)`. RELNOTES: - Removed the type name from the output of arrays. - For array subjects, made `named()` supplement the existing actual value text, not replace it. This brings it in line with other subjects' behaviors. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=186110526
- Loading branch information
1 parent
6cd8068
commit f4fabf2
Showing
10 changed files
with
141 additions
and
173 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.