apple / swift-foundation

The Foundation project
Apache License 2.0
2.29k stars 135 forks source link

FoundationEssentialsTests: we convert to FSR when checking #654

Closed compnerd closed 1 month ago

compnerd commented 1 month ago

The internal function returns a FSR value where as the value being returned from the appendingPathComponent is not the FSR. Explicitly convert to the FSR for the check.

compnerd commented 1 month ago

I'm not sure if there is a more elegant manner to handle this scenario. This value is being compared to an internal API which returns a FSR representation so it seems reasonable that the check would convert to the FSR when trying to check the result.

compnerd commented 1 month ago

@swift-ci please test

jmschonfeld commented 1 month ago

I'm not sure if there is a more elegant manner to handle this scenario. This value is being compared to an internal API which returns a FSR representation so it seems reasonable that the check would convert to the FSR when trying to check the result.

Yeah normally I'd want to avoid this and use a different API instead, but given we're testing an internal function I think it's probably fine. Presumably converting to the file system representation is normalizing something about the path?

compnerd commented 1 month ago

Correct - is the path separator being canonicalized.