diff --git a/rust-whisper-lib/src/lib.rs b/rust-whisper-lib/src/lib.rs index 622b810..e949f85 100644 --- a/rust-whisper-lib/src/lib.rs +++ b/rust-whisper-lib/src/lib.rs @@ -376,3 +376,29 @@ impl Listener { stream.pause().unwrap(); } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_transcribe_tiny_jfk_wav() { + main( + Flags { + model_path: None, + model_buffer: Some(include_bytes!("../../models/ggml-tiny.en.bin").to_vec()), + threads: 8, + stream_step: 0, + stream_retain: 0.0, + stream_head: 0.0, + stream_tail: 0.0, + wav: Some("../gitea-whisper-rs/sys/whisper.cpp/bindings/go/samples/jfk.wav".to_string()), + debug: false, + }, + | result | { + assert!(result.is_ok()); + assert_eq!(result.unwrap().to_string(), " And so my fellow Americans ask not what your country can do for you ask what you can do for your country."); + }, + ); + } +}