Skip to content

Commit

Permalink
Add test for slices of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
twistedfall committed Sep 2, 2024
1 parent 2411e6d commit 57c3248
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/marshalling.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Contains all tests that cover marshalling types to and from C++

use opencv::core;
use opencv::core::{Scalar, SparseMat, Tuple};
use opencv::core::{CommandLineParser, Scalar, SparseMat, Tuple};
use opencv::prelude::*;
use opencv::Result;

Expand Down Expand Up @@ -273,3 +273,12 @@ fn tuple() -> Result<()> {
// assert_eq!(mat.data_typed()?, mat_src.data_typed()?);
// Ok(())
// }

#[test]
fn string_array() -> Result<()> {
let args = ["test", "-a=b"];
let mut parser = CommandLineParser::new(i32::try_from(args.len())?, &args, "{a | | }")?;
assert!(parser.has("a")?);
assert_eq!("b", parser.get_str("a", true)?);
Ok(())
}

0 comments on commit 57c3248

Please sign in to comment.