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

Add additional test cases covering terminator flag #4

Closed
11 tasks done
TheLarkInn opened this issue Jan 19, 2023 · 0 comments · Fixed by #5
Closed
11 tasks done

Add additional test cases covering terminator flag #4

TheLarkInn opened this issue Jan 19, 2023 · 0 comments · Fixed by #5
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@TheLarkInn
Copy link
Owner

TheLarkInn commented Jan 19, 2023

Copy the test cases from original JavaScript project:

  • t.true(hasFlag('unicorn', ['--foo', '--unicorn', '--bar']));
  • t.true(hasFlag('--unicorn', ['--foo', '--unicorn', '--bar']), 'optional prefix');
  • t.true(hasFlag('unicorn=rainbow', ['--foo', '--unicorn=rainbow', '--bar']));
  • t.true(hasFlag('unicorn', ['--unicorn', '--', '--foo']));
  • t.false(hasFlag('unicorn', ['--foo', '--', '--unicorn']), 'don't match flags after terminator');
  • t.false(hasFlag('unicorn', ['--foo']));
  • t.true(hasFlag('-u', ['-f', '-u', '-b']));
  • t.true(hasFlag('-u', ['-u', '--', '-f']));
  • t.true(hasFlag('u', ['-f', '-u', '-b']));
  • t.true(hasFlag('u', ['-u', '--', '-f']));
  • t.false(hasFlag('f', ['-u', '--', '-f']));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant