keyhog-sources 0.5.42

keyhog-sources: pluggable input backends for KeyHog (git, S3, GCS, Azure Blob, Docker, Web)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use keyhog_core::Source;

#[cfg(feature = "web")]
#[test]
fn web_source_empty_urls_produce_no_chunks() {
    let source = keyhog_sources::WebSource::new(vec![]);
    let chunks: Vec<_> = source.chunks().collect();

    assert_eq!(source.name(), "web");
    assert!(chunks.is_empty());
}

#[cfg(feature = "web")]
#[test]
fn web_source_from_url_is_constructible() {
    let source = keyhog_sources::WebSource::new(vec!["https://example.com/app.js".to_string()]);
    assert_eq!(source.name(), "web");
}