Skip to content

Incorrect error message for .allRemainingInput options without values - #1003

Open
james-fletcher-01 wants to merge 3 commits into
apple:mainfrom
james-fletcher-01:array-remaining-missing-value-error
Open

james-fletcher-01 wants to merge 3 commits into
apple:mainfrom
james-fletcher-01:array-remaining-missing-value-error

Conversation

@james-fletcher-01

Copy link
Copy Markdown

Fixes #750

Issue #434 reported that when a label, but no values, are provided for an array @Option property, the error message incorrectly signifies a missing option instead of a missing value. PR #435 fixed this for .upToNextOption arrays, but the bug remained for .allRemainingInput arrays. This PR modifies the behaviour for .allRemainingInput to match that of .upToNextOption.

The parsing_repeatingStringRemaining_2 test previously expected options with a default value to use the default value when an option label is provided without a value. This has been modified to expect an error, as per the discussion in #750.

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

Issue apple#434 reported that when a label, but no values, are provided for an array @option property, the error message incorrectly signifies a missing option instead of a missing value. PR apple#435 fixed this for .upToNextOption arrays, but the bug remained for .allRemainingInput arrays.

In addition to tests for verifying the error message, this also adds tests to verify that an attached value counts for the validation. This was a regression for .upToNextOption introduced in apple#435 and fixed in apple#610.
The previous commit was authored prior to the Swift Testing migration
This test originally expected the `.allRemainingInput` option to use the default value when specifying the option label without a value, but this is now an error instead. The test has been updated to expect the error.

This branch has not been deployed

No deployments
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.

Incorrect error message for .allRemainingInput options without values

1 participant