дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
test(plugins): capability paths are the platform's in the parse test
Цей коміт міститься в:
1 джерело
8df7731fa6
коміт
14ddd948f8
1 file changed
+9
-4
@@ -230,13 +230,18 @@ mod tests {
|
||||
"net:crates.io",
|
||||
"net:*.github.com",
|
||||
"process:cargo",
|
||||
"fs.read:/etc",
|
||||
] {
|
||||
assert_eq!(s.parse::<Capability>().unwrap().to_string(), s);
|
||||
}
|
||||
// An absolute program path is the platform's.
|
||||
let git = if cfg!(windows) { r"process:C:\Program Files\Git\bin\git.exe" } else { "process:/usr/bin/git" };
|
||||
assert_eq!(git.parse::<Capability>().unwrap().to_string(), git);
|
||||
// Absolute paths are the platform's.
|
||||
let (git, etc) = if cfg!(windows) {
|
||||
(r"process:C:\Program Files\Git\bin\git.exe", r"fs.read:C:\Windows")
|
||||
} else {
|
||||
("process:/usr/bin/git", "fs.read:/etc")
|
||||
};
|
||||
for s in [git, etc] {
|
||||
assert_eq!(s.parse::<Capability>().unwrap().to_string(), s);
|
||||
}
|
||||
assert_eq!("project-read".parse::<Capability>().unwrap(), Capability::ProjectRead);
|
||||
assert!("net:".parse::<Capability>().is_err());
|
||||
assert!("net:a b".parse::<Capability>().is_err());
|
||||
|
||||
Reference in new issue
Заблокувати користувача