From e9b06af06f5ceb9635d208ae2a84faedc7d138dc Mon Sep 17 00:00:00 2001 From: bdbai Date: Mon, 11 Mar 2024 19:46:34 +0800 Subject: [PATCH] data proxy analyze test --- ytflow-app-util/src/proxy/data/analyze.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ytflow-app-util/src/proxy/data/analyze.rs b/ytflow-app-util/src/proxy/data/analyze.rs index d1982e5..6b60957 100644 --- a/ytflow-app-util/src/proxy/data/analyze.rs +++ b/ytflow-app-util/src/proxy/data/analyze.rs @@ -32,3 +32,14 @@ pub fn analyze_data_proxy(name: String, proxy: &[u8], version: u16) -> AnalyzeRe } super::v1::analyzer::analyze(name, proxy) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_analyze_data_proxy_invalid_version() { + let result = analyze_data_proxy("test".into(), &[], 1); + assert_eq!(result, Err(AnalyzeError::UnknownVersion)); + } +}