verso-reader 0.1.0

A terminal EPUB reader with vim navigation, a Kindle-style library, and Markdown highlight export
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::time::Duration;
use verso::library::watch::{spawn_watcher, LibraryEvent};

#[test]
fn emits_create_event() {
    let tmp = tempfile::tempdir().unwrap();
    let (rx, _handle) = spawn_watcher(tmp.path()).unwrap();

    std::fs::write(tmp.path().join("a.epub"), b"stub").unwrap();

    let ev = rx.recv_timeout(Duration::from_secs(3)).expect("no event");
    assert!(matches!(
        ev,
        LibraryEvent::Created(_) | LibraryEvent::Changed
    ));
}