Skip to content
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

Swapping the order of got/expected #51

Closed
Julian opened this issue Jan 16, 2021 · 3 comments
Closed

Swapping the order of got/expected #51

Julian opened this issue Jan 16, 2021 · 3 comments

Comments

@Julian
Copy link

Julian commented Jan 16, 2021

Sorry, this is really petty, but going to ask anyways :)

I don't suppose there's an existing way to swap which argument in plenary's test framework is considered "got" and which is "expected"?

I.e. assert.is.equal(2, 3) currently assumes 2 is expected. Obviously this matters only for the error messages it looks like are printed.

Both conventions are common I think -- got, expected and expected, got, but yeah can this be swapped or not currently (or ever?)?

@Conni2461
Copy link
Collaborator

I think thats actually definied by luassert which is bundled with plenary. So i wouldn't change it.

But i am not the author of this plugins so tj needs to answer it

@Julian
Copy link
Author

Julian commented Jan 16, 2021

Ah thanks, I checked busted's docs (before you reminded me busted's docs aren't relevant anyhow) but not luassert, ok, will look to see if it has a way to do so.

@Conni2461
Copy link
Collaborator

FWIW and before i go to sleep why not doing this:

local eq = function(got, expected)
  assert.are.same(expected, got)
end

@Julian Julian closed this as completed Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants