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

Remove low-value argument test #1701

Merged
merged 1 commit into from Mar 14, 2022

Conversation

shadowspawn
Copy link
Collaborator

Long story for small deletion.

I suggested this test as part of adding single string support.

I noticed it today because it is not covered by a unit test. Rather than adding a unit test, I think perhaps just delete the check. I don't think it is providing much value, and I suggest deleting it and if anyone reports problems using the API then add tests when we know what mistakes people make.

The previous situation was the routine expected an array and would silently do the wrong thing if a single string was passed. And two of us made that very mistake!

// early API required array like:
option.conflicts(['one']);
// early API silently did weird things if passed single string
option.conflicts('one');

New API supports both forms:

option.conflicts(['one']);
option.conflicts('one');

What I think the most likely user mistake now might be, and not too likely:

option.conflicts('one', 'two');

And the current test won't detect that! So suggesting keep it simple, delete for now.

Copy link
Collaborator

@abetomo abetomo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@shadowspawn shadowspawn merged commit 019499b into tj:develop Mar 14, 2022
@shadowspawn shadowspawn deleted the feature/remove-argument-check branch March 14, 2022 08:10
@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Mar 14, 2022
@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Apr 10, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants