Skip to content

"cleanPath" of Strings in elasticsearch/common pacake does not work as the function description #20851

@wenpos

Description

@wenpos

When add a unit test for method "cleanPath" of Strings in elasticsearch/common package, the test results turn out to be far from its function description:
Normalize the path by suppressing sequences like ""path/.."and inner simple dots
--that means path like "/root/../home" would be suppressed as path "/home", but actually the test case failed.
--the below example original paths would be suppressed as the Expected normalized path, but actually not:
Original Expetced: Actual:
"/root//home" "/root/home" "/root//home"
"/root/../home" "/home" "/root/../home"
"/root/../home" "home" "/root/../home"
"file:./root/../home/elk" "file:home/elk" "file:./root/../home/elk"
Some common util classes and methods deserve more attention : )

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions