Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix #4872: Implement java.util.StringJoiner.#4873

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sjrd merged 1 commit intoscala-js:mainfromsjrd:stringjoiner
Jun 1, 2023

Conversation

@sjrd
Copy link
Member

No description provided.

@sjrdsjrd requested a review fromgzm0May 30, 2023 12:20
Copy link
Contributor

@gzm0gzm0 left a comment

Choose a reason for hiding this comment

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

Just some comments RE test cases.

val single = new StringJoiner(";", "[", "]").setEmptyValue("--").add("single")
val multiple = new StringJoiner(";", "[", "]").setEmptyValue("--").add("a").add("b").add("c")

assertJoinerResult("+++") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add a test case checking that the empty value of the lhs is taken?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Hum, isn't that what this test precisely does?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I meant something like:

newStringJoiner(",","{","}").setEmptyValue("+++").merge(empty)

Basically testing thatmerge doesn't override the empty value.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ah yes I see. Added.

@sjrd
Copy link
MemberAuthor

Updated. I also added a bunch of tests withblank elements (empty string elements that make the joiner non-empty).

@sjrdsjrd requested a review fromgzm0May 31, 2023 09:37
Copy link
Contributor

@gzm0gzm0 left a comment

Choose a reason for hiding this comment

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

Just some minor comments RE tests.

val single = new StringJoiner(";", "[", "]").setEmptyValue("--").add("single")
val multiple = new StringJoiner(";", "[", "]").setEmptyValue("--").add("a").add("b").add("c")

assertJoinerResult("+++") {
Copy link
Contributor

Choose a reason for hiding this comment

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

No, I meant something like:

newStringJoiner(",","{","}").setEmptyValue("+++").merge(empty)

Basically testing thatmerge doesn't override the empty value.

new StringJoiner(", ", "[", "]").add("one").merge(singleBlank).add("two")
}
assertJoinerResult("[single]") {
new StringJoiner(", ", "[", "]").merge(single)
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider putting different prefix / suffix tosingle to check that they are not used.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Oops, I meant to do that all along. Good catch.

@sjrdsjrd merged commit57d71da intoscala-js:mainJun 1, 2023
@sjrdsjrd deleted the stringjoiner branchJune 1, 2023 06:15
WojciechMazur pushed a commit to scala-native/scala-native that referenced this pull requestAug 8, 2023
* Support java.util.StringJoiner- ported from Scala.jsscala-js/scala-js#4873
WojciechMazur pushed a commit to WojciechMazur/scala-native that referenced this pull requestSep 1, 2023
* Support java.util.StringJoiner- ported from Scala.jsscala-js/scala-js#4873(cherry picked from commitb1bba76)
WojciechMazur pushed a commit to scala-native/scala-native that referenced this pull requestSep 4, 2023
* Support java.util.StringJoiner- ported from Scala.jsscala-js/scala-js#4873(cherry picked from commitb1bba76)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gzm0gzm0gzm0 approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@sjrd@gzm0

[8]ページ先頭

©2009-2025 Movatter.jp