Comments (9)
Semi-related is (internal) bug 18722931 where I asked Colin to "polish up PathSubject and put it somewhere common".
from truth.
+1 on resolving the ambiguity; it took me a while to realize Path
is an Iterable<Path>
and a Comparable<Path>
.
from truth.
+1 for the PathSubject. Currently the following does not compile due to method ambiguity:
@Test
public void shouldConvertToPath() throws IOException {
// given
final Path expectedPath = ...;
// when
final Path convertedPath = ...;
// then
ASSERT.that(convertedPath).isEqualTo(expectedPath);
}
Declaring convertedPath
as Object
resolves the ambiguity. It's fine in this case since i'm treating convertedPath
as an Object
anyway, but having a specialized PathSubject sure would be nice!
from truth.
+1, just hit the same issue.
from truth.
Hey @cgdecker - this would be a good thing. Let's sync about how I can help you get it moved in. I'd really like to see this in for 1.0.
from truth.
To be honest, I've lost track of this and would have to dig up what I'd done again. I don't think it was ready or that we'd even worked out the API issues really. And I don't think I really have time to work on it this quarter. If you do want to try to push on getting this in, I can probably find what I had in terms of API plan and/or implementation and you can try to take it from there though.
from truth.
+1, I just hit this issue as well
from truth.
See #285 for PathSubject
; I'd like to see that added, even just as a stub.
from truth.
PathSubject
exists as part of the Truth8 extension now, mostly to resolve the ambiguity of IterableSubject
and ComparableSubject
:
Leaving this open to decide how to do more assertions on the Path
object.
from truth.
Related Issues (20)
- Consider reducing ImmutableList array copying HOT 1
- Wanted: Truth8Junit to support Java 8 types with assume() HOT 3
- Compatibility with gradle 7.6 HOT 2
- UsingCorrespondence should fail on use of equals(), like Subject does
- 1.1.4, Guava update leads to java.lang.UnsupportedOperationException at WindowsSecurityDescriptor.java:358 HOT 2
- Add StringSubject isNotBlank or hasText HOT 2
- Idk
- com.google.guava:guava library version update HOT 2
- Matching on exact class type, not a subtype HOT 2
- Can Truth assert a method throw exception? HOT 1
- Protobuf: allow unpopulated required fields when `comparingExpectedFieldsOnly` HOT 5
- Truth 1.1+ depends on Java 8 bytecode HOT 3
- FAQ entry: Why we don't support multiple chained calls to assertion methods on the same Subject HOT 3
- Port a core set of unit tests to kotlin HOT 2
- JUnit5 support for the existing soft-assertions support (Expect.create JUnit4 Rule) HOT 5
- Document when arrays are compared by their contents vs. their object identity HOT 3
- New extension for Gradle's TestKit HOT 1
- Asymmetric matchers like Jest's expect.stringContaining("") ? HOT 3
- Add MapSubject#containsAnyOf HOT 2
- Allow logical operations on assertions HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from truth.