perl-workspace-folder 0.12.2

Parse Perl workspace folder declarations into filesystem paths
Documentation
use perl_workspace_folder::workspace_folder_to_path;
use std::path::PathBuf;

#[test]
fn given_plain_path_when_resolving_then_path_is_returned() {
    let parsed = workspace_folder_to_path("/tmp/project");
    assert_eq!(parsed, PathBuf::from("/tmp/project"));
}

#[test]
fn given_file_uri_when_resolving_then_path_is_returned() {
    let parsed = workspace_folder_to_path("file:///tmp/workspace");
    assert!(!parsed.to_string_lossy().contains("file://"));
    assert!(parsed.to_string_lossy().contains("tmp"));
}

#[test]
fn given_file_uri_with_unresolvable_path_when_resolving_then_scheme_is_stripped() {
    let parsed = workspace_folder_to_path("file://relative/example");
    assert!(!parsed.to_string_lossy().contains("file://"));
    assert!(parsed.ends_with("relative/example"));
}