Open Hexstream opened 5 years ago
In this verison the comparator is applied to two lists, rather than being element-wise, though, so for instance (are = '(1 2) (values 1 2))
would fail. This seems like unexpected behaviour to me. If anything, it should expand to an is-values
or to something that evaluates a multiple-value-comparison-result
.
I use are
with equal
and equalp
comparators only.
I haven't needed more granularity than that thus far. It's very convenient.
edit: (are equal '(1 2) (values 1 2))
in your example.
I'd assume that are
would need to call the comparator element-wise, while ensuring the lists are of the same length. I don't think that restricting the number of test functions to equal
and equalp
is a good idea here.
I wouldn't mind if support for element-wise comparison was added, but multiple values usually have heterogeneous semantics and types anyway, so I don't think it's that important in this case.
That's demonstrably false though.
I live and die by multiple values and that has been my general impression, if you could demonstrate it false that would be great.
but multiple values usually have heterogeneous semantics and types anyway
If that is true, then the proper way would be to multiple-value-bind
these values and do multiple is
calls with multiple predicates. You cannot reliably test something that has heterogenous semantics and types with a single generic predicate like equal
or equalp
.
Having to specify multiple comparison predicates is what I specifically want to avoid, since that's way too verbose.
Here are my most are
-intensive test suites:
place-utils, its, place-modifiers, multiple-value-variants, first-time-value.
You cannot reliably test something that has heterogenous semantics and types with a single generic predicate like
equal
orequalp
.
Disagree, what you're missing is that I'm testing values against simple known static literal values.
You're asking to call the comparator element-wise, while ensuring the lists are of the same length
, well guess what, equal
does that, and even recursively, and I don't have to type out and then read multiple comparison predicates...
Hello,
Thanks for Parachute, I've started using it for all my (ready-to-use) libraries.
Just a quick note to let you know that I always found
is-values
to be completely unusable because it's way too verbose. Which was tragic for someone like me who lives and dies by multiple values.Fortunately, I quickly came up with
are
, which I find at least 10x more convenient. I love how trivial this was to implement thanks to Parachute's design.There are a bunch of usage examples here.
I hope you like it. I would love if this was integrated so that it can help other people and so that I don't have to copy/paste it in all of my test suites. (I don't really want to make my own personal "parachute-utils" library just for this either.)
Sorry, I'm pretty busy so I'm not too eager to make a proper pull request.