Closed jmagaram closed 1 year ago
This looks quite verbose but I couldn't figure out how to shorten it. Each flavor of test.each has a distinct signature. The array version, for example, can be called with array<(int, string,int)>
and requires a callback with 3 parameters while array<(string,int)>
requires a callback with 2 parameters. I think these require different external
bindings since the callbacks have a different number of parameters. I tried using functors to eliminate repetitive code but couldn't figure it out since the resultant modules need generic types, like a callback ('a,'b,'c)=>unit
.
Thank you @jmagaram !
I've never created a pull request before. Not sure how to do it. This is for "test.each" and "describe.each". Tests included. Seems to work.