Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T06:51:28.884Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

yarn.rs

38 lines · 1.3 KB · rust
1use project::yarn::*;
2use std::path::Path;
3
4#[test]
5fn test_resolve_virtual() {
6    let test_cases = vec![
7        (
8            "/path/to/some/folder/__virtual__/a0b1c2d3/0/subpath/to/file.dat",
9            Some(Path::new("/path/to/some/folder/subpath/to/file.dat")),
10        ),
11        (
12            "/path/to/some/folder/__virtual__/e4f5a0b1/0/subpath/to/file.dat",
13            Some(Path::new("/path/to/some/folder/subpath/to/file.dat")),
14        ),
15        (
16            "/path/to/some/folder/__virtual__/a0b1c2d3/1/subpath/to/file.dat",
17            Some(Path::new("/path/to/some/subpath/to/file.dat")),
18        ),
19        (
20            "/path/to/some/folder/__virtual__/a0b1c2d3/3/subpath/to/file.dat",
21            Some(Path::new("/path/subpath/to/file.dat")),
22        ),
23        ("/path/to/nonvirtual/", None),
24        ("/path/to/malformed/__virtual__", None),
25        ("/path/to/malformed/__virtual__/a0b1c2d3", None),
26        (
27            "/path/to/malformed/__virtual__/a0b1c2d3/this-should-be-a-number",
28            None,
29        ),
30    ];
31
32    for (input, expected) in test_cases {
33        let input_path = Path::new(input);
34        let resolved_path = resolve_virtual(input_path);
35        assert_eq!(resolved_path.as_deref(), expected);
36    }
37}
38
Served at tenant.openagents/omega Member data and write actions are omitted.