From c5617f6a47569f1f8ea04846c80b92ce78cc679c Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 6 Apr 2018 12:01:17 +0200 Subject: [PATCH] WIP: test Structure string conversions --- gstreamer/src/structure.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gstreamer/src/structure.rs b/gstreamer/src/structure.rs index 0050a7eef..44ac8cf4b 100644 --- a/gstreamer/src/structure.rs +++ b/gstreamer/src/structure.rs @@ -694,4 +694,15 @@ mod tests { assert_eq!(s.get::<&str>("f2").unwrap(), "bcd"); assert_eq!(s.get::("f3").unwrap(), 123i32); } + + #[test] + fn test_string_conversion() { + let a = "Test, f1=(string)abc, f2=(uint)123"; + + let s = Structure::from_string(&a).unwrap(); + assert_eq!(s.get::<&str>("f1").unwrap(), "abc"); + assert_eq!(s.get::("f2").unwrap(), 123); + + assert_eq!(a, s.to_string()); + } }