#[test]
fn high_level_test() {
    use fanotify::high_level::*;
    use std::io::{Read, Write};
    let ft = Fanotify::new_with_blocking(FanotifyMode::NOTIF);
    ft.add_path(
        FAN_ACCESS | FAN_CLOSE | FAN_EVENT_ON_CHILD | FAN_MODIFY | FAN_ONDIR | FAN_OPEN,
        "/tmp",
    )
    .unwrap();
    let handler = std::thread::spawn(|| {
        let mut tmp = std::fs::File::create("/tmp/fanotify_test").unwrap();
        tmp.write_all(b"xxx").unwrap();
        let mut tmp = std::fs::File::open("/tmp/fanotify_test").unwrap();
        let mut res = "".to_string();
        tmp.read_to_string(&mut res).unwrap();
        assert_eq!(res, "xxx".to_string());
    });
    handler.join().unwrap();
}
