lfex / ltest

A Testing Framework for LFE (successor to lfeunit)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add macros for _assert*

yurrriq opened this issue Β· comments

I'm using these in xlfe right now, but it'd be nice to bake something into ltest.

(defmacro is-equal* (x y)
  `(_assertEqual ,x ,y))

(defmacro is-error* (x y)
  `(_assertError ,x ,y))

TODO

  • Update is-{,not-}exception{,*}
  • Update is-{,not-}error{,*}
  • Update is-{,not-}exit{,*}
  • Update is-{,not-}throw{,*}

Add convenient unary clauses that pass _ as the first argument to the binary versions.

I think this is a good idea -- you ready for a PR?

I don't have anything prepared yet. Also, I'm not sold on the gen- naming scheme. Do you have a better idea?

Do you really need them? They just rename other macros. How about calling then assert-equal and assert-error?

@rvirding, we have those, but I need the _-prefixed ones, for writing test generators. It's totally a cosmetic concern to add lispy aliases. (_assertEqual this that) looks bad to me. 😈

Oh hey! What about assert-equal* to follow the * naming scheme for alternates?

Can you be consistent with the names? You could do assert-gen-equal and assert-gen-error. Consistent and explicit but maybe a bit long. Or not. Or assert-equal-gen and assert-error-gen?

If you used assert-equal* etc then all the generator macros would have to end in '*', our version of starting with a '_'.

Right. That's what I was thinking. We can do postfix * for EUnit's prefix _.

I'm gonna do a PR while it's fresh in my mind, but then I'm really gonna work on lmug. πŸ˜„

Nice! (to both)

On Sun, Mar 20, 2016 at 12:46 PM, Eric Bailey notifications@github.com
wrote:

I'm gonna do a PR while it's fresh in my mind, but then I'm really gonna
work on lmug. [image: πŸ˜„]

β€”
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#36 (comment)

Ok, so this got messier than I thought. I actually found a bug in the current version of Lodox when trying to generate ltest documentation...

There's also apparently a breaking change in EUnit somewhere around R18. I've separated the concerns into branches and develop has them all merged. The tests are green on my develop branch, but I still have to write/update generator tests.

This is why I value the Great Path of the Shaven Yak so highly :-) The road may not be direct -- nor easy -- but is has the power to give us better software if followed well and truly ... !

cc @cemerick

meta-yak

I said it in PR #37 and I'll say it here: well done, @yurrriq! Great changes!

πŸŽ‰ Cheers!