Skip to content

CharMatchers 组件中 CollapseFrom 行为异常 #1

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

Open
alexinea opened this issue Oct 14, 2021 · 0 comments
Open

CharMatchers 组件中 CollapseFrom 行为异常 #1

alexinea opened this issue Oct 14, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@alexinea
Copy link
Contributor

正确的行为应该形如:

@Test
public void whenCollapseFromString_thenCollapsed() {
    String input = "       hel    lo      ";

    String result = CharMatcher.is(' ').collapseFrom(input, '-');
    assertEquals("-hel-lo-", result);

    result = CharMatcher.is(' ').trimAndCollapseFrom(input, '-');
    assertEquals("hel-lo", result);
}
@alexinea alexinea added the bug Something isn't working label Oct 14, 2021
@alexinea alexinea changed the title CharMatchers 组建中 CollapseFrom 行为异常 CharMatchers 组件中 CollapseFrom 行为异常 Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant