Debian Codegraph @

tests/runtime.rs

raw symbols SCIP
1 use caps::runtime;
2
3 #[test]
4 fn test_ambient_supported() {
5 runtime::ambient_set_supported().unwrap();
6 }
7
8 #[test]
9 fn test_thread_all_supported() {
10 assert!(runtime::thread_all_supported().len() > 0);
11 assert!(runtime::thread_all_supported().len() <= caps::all().len());
12 }
13
14 #[test]
15 fn test_procfs_all_supported() {
16 use std::path::PathBuf;
17
18 let p1 = runtime::procfs_all_supported(None).unwrap();
19 let p2 = runtime::procfs_all_supported(Some(PathBuf::from("/proc"))).unwrap();
20 let thread = runtime::thread_all_supported();
21 let all = caps::all();
22
23 assert!(thread.len() > 0);
24 assert!(thread.len() <= all.len());
25 assert_eq!(
26 p1,
27 p2,
28 "{:?}",
29 p1.symmetric_difference(&p2).collect::<Vec<_>>()
30 );
31 assert_eq!(
32 p1,
33 thread,
34 "{:?}",
35 p1.symmetric_difference(&thread).collect::<Vec<_>>()
36 );
37 }