-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comparing Arrays does (sometimes) not work. Problem with Objects? #96
Comments
Hi @skruppy, I updated the way how the asserts work in 0.14 so this is not a cast problem, because now there are no casts. The problem comes from the fact that the assert operation is not defined for those types. I'll have a look at it. This happens here: https://github.com/gedaiu/fluent-asserts/blob/master/source/fluentasserts/core/lifecycle.d#L31 |
I just made another release which enables those operations. Please let me know how it works for you. |
Thanks for the quick fix and release 👍 . The MWE seems to work fine with the 0.14.0-alpha.8 release. Testing with my bigger Project is currently not so easy because of #97. I will comment/close on this here issue if I worked around the other issues. |
I tested a little bit further and I seems the examples above work, but associative arrays won't. They have worked prior version 0.14. See the following MWE (I hope this problem fits into the same bug report): import std.stdio;
import fluent.asserts;
void main() {}
unittest {
string[] l = ["1", "2"];
assert(l == l); // works
l.should.equal(l); // works
string[string] al = ["k1": "v1", "k2": "v2"];
assert(al == al); // works
al.should.equal(al); // Fails: There is no `string[string].string[string].equal` or `*[string].*[string].equal` registered to the assert operations.
} |
Tested with 0.14.0-alpha.7 I got the following results:
This doesn't make any sense to me. I think all assertions should pass without error. The last two tests are taken from #85 and should have worked earlier, but not any more.
The text was updated successfully, but these errors were encountered: