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 test case for shouldEscape #38

Closed
borozcod opened this issue Dec 21, 2023 · 0 comments
Closed

Add test case for shouldEscape #38

borozcod opened this issue Dec 21, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@borozcod
Copy link
Contributor

borozcod commented Dec 21, 2023

private val ESCAPE_CHARACTERS = charArrayOf(' ', '"', '#', '+', ',', ';', '<', '=', '>', '\\')
private fun Char.shouldEscape(): Boolean = this.code.let { codepoint ->
when (codepoint) {
in 0x3f..0x7e -> codepoint == 0x5c // the only forbidden character is backslash
in 0x2d..0x3a -> false // minus, point, slash (allowed), digits + colon :
in 0x24..0x2a -> false // $%&'()*
0x21 -> false // exclamation
else -> true
}
}

Related PR: #36

@borozcod borozcod added the help wanted Extra attention is needed label Dec 21, 2023
@borozcod borozcod added this to Flexo Dec 21, 2023
@github-project-automation github-project-automation bot moved this to New in Flexo Dec 21, 2023
@borozcod borozcod moved this from New to Backlog in Flexo Dec 21, 2023
@borozcod borozcod moved this from Backlog to Ready in Flexo Dec 21, 2023
@github-project-automation github-project-automation bot moved this from Ready to Done in Flexo Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Status: Done
Development

No branches or pull requests

2 participants