SwensenSoftware / unquote

Write F# unit test assertions as quoted expressions, get step-by-step failure messages for free
http://www.swensensoftware.com/unquote
Apache License 2.0
285 stars 26 forks source link

Maybe extract Swensen.Unquote.Operators into separate package? #117

Closed wastaz closed 8 years ago

wastaz commented 8 years ago

Maybe I'm just being silly here - and please feel free to just call me silly and close this issue if I am - but I'm very interested in using the quotation evaluator from Swensen.Unquote.Operators in my project as it solves exactly the problem that I am currently wrestling with. (Really! I plugged it in, called evalRaw and suddenly all my tests are green again!)

However, I feel a bit weird referencing Unquote for just this part since it's mainly a test assertion lib, and I'm not actually using it for test assertions - I'm using it to evaluate part of quotations inside other quotations.

This part with the quotation evaluator feels like it should be possible to extract into it's own project/package that could be referenced separately from unquote itself (but as said earlier, I may just be extremely silly here) in case you are in my position and need a quotation evaluator that doesn't suck.

stephen-swensen commented 8 years ago

Glad to hear how well Unquote is working for you!

It's not a silly question, one I've considered myself too. Interestingly, though the original purpose of Unquote was as a testing lib, the evaluation and decompilation features are the real stars and easily comprise about 90% of the code.

But at this time, I think keeping Unquote as a single package (a single .dll in fact), is preferable for simplicity. I purposely created Swensen.Unquote.Operators and Swensen.Unquote.Assertions as organization boundaries so that it would be easier for library users to avoid the assertion bits if they only needed the decompilation or evaluation bits, as in your case.

To ease your mind, you can think of Unquote as an evaluation and decompilation library that has some assertion functionality tacked on :)

stephen-swensen commented 8 years ago

@wastaz question: are you using evalRawWith or just evalRaw? I ask because as part of #114 I had to change the signature of evalRawWith so that it accepts a map of Var keys to obj values instead of a map of string keys to obj values (it turns out quotation variables cannot be reliably referenced by name). This has no impact on your use of evalRaw, but if you are using evalRawWith I want to make sure this change doesn't create a big burden for you.

Thanks!

wastaz commented 8 years ago

@stephen-swensen Thanks for asking! :) I'm just using evalRaw, so I won't be affected by this.