We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a99fcf commit df25b76Copy full SHA for df25b76
1 file changed
crates/mac_core/src/array.rs
@@ -71,3 +71,22 @@ impl<T: CoreType> CFArray<T> {
71
unsafe { T::new_borrowed(ptr.cast()) }
72
}
73
74
+
75
+#[cfg(test)]
76
+mod tests {
77
+ use super::*;
78
+ use crate::CFString;
79
80
+ #[test]
81
+ fn test_array_index() {
82
+ let foo = CFString::new("foo");
83
+ let bar = CFString::new("bar");
84
85
+ let arr = CFArray::new(&[foo.clone(), bar.clone()]);
86
87
+ assert_eq!(arr[0].as_type_ref(), foo.as_type_ref());
88
+ assert_eq!(arr[1].as_type_ref(), bar.as_type_ref());
89
+ assert_eq!(arr[0].as_str(), "foo");
90
+ assert_eq!(arr[1].as_str(), "bar");
91
+ }
92
+}
0 commit comments