Skip to content

Commit 57c3248

Browse files
committed
Add test for slices of strings
1 parent 2411e6d commit 57c3248

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/marshalling.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Contains all tests that cover marshalling types to and from C++
22
33
use opencv::core;
4-
use opencv::core::{Scalar, SparseMat, Tuple};
4+
use opencv::core::{CommandLineParser, Scalar, SparseMat, Tuple};
55
use opencv::prelude::*;
66
use opencv::Result;
77

@@ -273,3 +273,12 @@ fn tuple() -> Result<()> {
273273
// assert_eq!(mat.data_typed()?, mat_src.data_typed()?);
274274
// Ok(())
275275
// }
276+
277+
#[test]
278+
fn string_array() -> Result<()> {
279+
let args = ["test", "-a=b"];
280+
let mut parser = CommandLineParser::new(i32::try_from(args.len())?, &args, "{a | | }")?;
281+
assert!(parser.has("a")?);
282+
assert_eq!("b", parser.get_str("a", true)?);
283+
Ok(())
284+
}

0 commit comments

Comments
 (0)