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 tests for string.split() #1841

Merged
merged 14 commits into from
Dec 16, 2022
Merged

Add tests for string.split() #1841

merged 14 commits into from
Dec 16, 2022

Conversation

dvdherron
Copy link
Contributor

Closes: #1832
See: sass/sass#1950

[skip dart-sass]

spec/core_functions/string/split.hrx Outdated Show resolved Hide resolved
spec/core_functions/string/split.hrx Outdated Show resolved Hide resolved
spec/core_functions/string/split.hrx Outdated Show resolved Hide resolved
spec/core_functions/string/split.hrx Outdated Show resolved Hide resolved
spec/core_functions/string/split.hrx Show resolved Hide resolved
spec/core_functions/string/split.hrx Outdated Show resolved Hide resolved
spec/core_functions/string/split.hrx Outdated Show resolved Hide resolved
@dvdherron dvdherron requested a review from nex3 November 21, 2022 13:34
Copy link
Contributor

@nex3 nex3 left a comment

Choose a reason for hiding this comment

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

Looks good, although I may have a couple more comments once I implement this and run the tests against the implementation.

spec/core_functions/string/split.hrx Show resolved Hide resolved
Copy link
Contributor

@nex3 nex3 left a comment

Choose a reason for hiding this comment

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

A couple missing tests I only noticed once I started in on the implementation:

  • The function should return a comma separator even for empty and single-element lists.
  • The function should accept unquoted strings, and should return an unquoted string if $string is unquoted.

There are a couple other small things, but I can auto-update them once I have write access to the PR.

spec/core_functions/string/split.hrx Outdated Show resolved Hide resolved
@dvdherron
Copy link
Contributor Author

Added new tests for unquoted strings and checking the separator type for empty and single-element lists in 175359d. I think this covers the changes requested.

@dvdherron dvdherron requested a review from nex3 December 12, 2022 17:24
@nex3
Copy link
Contributor

nex3 commented Dec 15, 2022

Test failures should be fixed when sass/embedded-host-node#175 lands.

@nex3 nex3 merged commit 6e47b00 into sass:main Dec 16, 2022
@nex3 nex3 deleted the string-split branch December 16, 2022 23:53
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.

Add tests for string.split()
2 participants