Feature summary
So, I'm noticing that my attempts to validate that this toString() and getVersion are returning the same thing is kind of painful.
Example
// using semver4j, note this won't pass because my code subclasses and stuff even then, but compiling
var v010 = Semver.coerce("v0.1.0");
// asserthat(v010).matchesToString(...) nope doesn't exist
assertThat(v010)
.extracting(Semver::getVersion, Semver::toString)
.allSatisfy(o -> {
assertThat(o).isInstanceOf(String.class); // I guess chaining off this assertion won't convince allowance of matches
if (o instanceof String s) { // but couldn't o already have determined we're a string?
assertThat(s).matches("^0\\.1\\.0-SNAPSHOT-1-g\\p{XDigit}{7}$");
}
});
Feature summary
So, I'm noticing that my attempts to validate that this
toString()andgetVersionare returning the same thing is kind of painful.Example