test: add NA, empty string, and mixed whitespace tests for str_trim/str_squish#606
Closed
LeonidasZhak wants to merge 1 commit into
Closed
test: add NA, empty string, and mixed whitespace tests for str_trim/str_squish#606LeonidasZhak wants to merge 1 commit into
LeonidasZhak wants to merge 1 commit into
Conversation
…tr_squish Add edge-case tests for data cleaning scenarios: - NA passthrough in str_trim (all side variants) and str_squish - Empty string and whitespace-only string handling - Newlines, CRLF, and mixed whitespace in str_squish The DESCRIPTION promises consistent NA handling but these cases were untested. str_trunc has analogous NA tests (test-trunc.R:1-10).
Author
|
Withdrawing this small automated PR while I consolidate an oversized batch of contributions and reduce maintainer review burden. Sorry for the noise, and thank you for maintaining the project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds edge-case test coverage for
str_trim()andstr_squish():NAvalues (single and mixed with non-NA)str_squish()with newlines (\n), carriage returns (\r\n), tabs (\t), and combinationsMotivation
These edge cases are important for data cleaning workflows where inputs commonly contain NAs, empty strings, and mixed whitespace characters. The tests ensure consistent behavior and guard against regressions.
Tests run
All 27 tests pass, including the 5 new test blocks (30 assertions).