File: main.rs

package info (click to toggle)
rust-rlimit 0.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 240 kB
  • sloc: python: 142; sh: 13; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 485 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#[cfg(target_os = "linux")]
mod linux;

#[cfg(unix)]
mod unix;

#[cfg(windows)]
mod windows;

#[allow(unused)]
use std::io;

#[allow(unused)]
#[track_caller]
fn expect_ok(result: io::Result<()>) {
    assert!(result.is_ok());
}

#[allow(unused)]
#[track_caller]
fn expect_err(result: io::Result<()>, kind: io::ErrorKind) {
    assert_eq!(result.unwrap_err().kind(), kind);
}

#[test]
fn tools_nofile() {
    let lim = rlimit::increase_nofile_limit(u64::MAX).unwrap();
    dbg!(lim);
}