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

Make quote character in @CsvSource and @CsvFileSource configurable #2735

Closed
3 tasks done
sbrannen opened this issue Oct 1, 2021 · 2 comments
Closed
3 tasks done

Make quote character in @CsvSource and @CsvFileSource configurable #2735

sbrannen opened this issue Oct 1, 2021 · 2 comments

Comments

@sbrannen
Copy link
Member

sbrannen commented Oct 1, 2021

Overview

In order to treat text blocks as files in @CsvSource (see #2734), we should allow users to change the quote character to " when using text blocks.

This will of course allow one to change the quote character to anything other than ' or ", even when using the value attribute in @CsvSource, but it is assumed the primary use case is using double quotes in text blocks.

For consistency in supported features, we should do the same for @CsvFileSource.

Related Issues

Deliverables

  • Introduce new char quoteCharacter() default '\''; attribute in @CsvSource.
  • Introduce new char quoteCharacter() default '"'; attribute in @CsvFileSource.
  • Document in the Release Notes.
@sbrannen
Copy link
Member Author

sbrannen commented Oct 1, 2021

Current work on this issue can be viewed in the following feature branch:

main...sbrannen:issues/2735-make-quote-character-in-CsvSource-configurable

sbrannen added a commit to sbrannen/junit5 that referenced this issue Oct 2, 2021
Prior to this commit, the quote character for quoted strings in
@CsvSource was hard coded to a single quote (') and could not be
changed; however, with the recently added support for text blocks, it
may be desirable to change the quote character to something else.

This commit introduces a new quoteCharacter attribute in @CsvSource
that allows the user to change the quote character. The quoteCharacter
defaults to a single quote for backward compatibility.

Closes junit-team#2735
sbrannen added a commit that referenced this issue Oct 2, 2021
Prior to this commit, the quote character for quoted strings in
@CsvSource was hard coded to a single quote (') and could not be
changed; however, with the recently added support for text blocks, it
may be desirable to change the quote character to something else.

This commit introduces a new quoteCharacter attribute in @CsvSource
that allows the user to change the quote character. The quoteCharacter
defaults to a single quote for backward compatibility.

Closes #2735
@sbrannen
Copy link
Member Author

sbrannen commented Nov 3, 2021

Reopening to add the same support for @CsvFileSource.

@sbrannen sbrannen reopened this Nov 3, 2021
@sbrannen sbrannen changed the title Make quote character in @CsvSource configurable Make quote character in @CsvSource and @CsvFileSource configurable Nov 3, 2021
sbrannen added a commit that referenced this issue Nov 5, 2021
Prior to this commit, the quote character for quoted strings in
@CsvFileSource was hard coded to a double quote (") and could not be
changed.

Commit f1cbfbe introduced a new quoteCharacter attribute in
@CsvSource that allows the user to change the quote character.

For consistency between the two features, this commit introduces a new
quoteCharacter attribute in @CsvFileSource. The quoteCharacter defaults
to a double quote for backward compatibility.

Closes #2735
runningcode pushed a commit to runningcode/junit5 that referenced this issue Feb 15, 2023
Prior to this commit, the quote character for quoted strings in
@CsvSource was hard coded to a single quote (') and could not be
changed; however, with the recently added support for text blocks, it
may be desirable to change the quote character to something else.

This commit introduces a new quoteCharacter attribute in @CsvSource
that allows the user to change the quote character. The quoteCharacter
defaults to a single quote for backward compatibility.

Closes junit-team#2735
runningcode pushed a commit to runningcode/junit5 that referenced this issue Feb 15, 2023
runningcode pushed a commit to runningcode/junit5 that referenced this issue Feb 15, 2023
Prior to this commit, the quote character for quoted strings in
@CsvFileSource was hard coded to a double quote (") and could not be
changed.

Commit f1cbfbe introduced a new quoteCharacter attribute in
@CsvSource that allows the user to change the quote character.

For consistency between the two features, this commit introduces a new
quoteCharacter attribute in @CsvFileSource. The quoteCharacter defaults
to a double quote for backward compatibility.

Closes junit-team#2735
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant