We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f71e74c commit 1f823d5Copy full SHA for 1f823d5
hdf5-rs/src/hl/group.rs
@@ -199,6 +199,25 @@ pub mod tests {
199
})
200
}
201
202
+ #[test]
203
+ pub fn test_clone() {
204
+ with_tmp_file(|file| {
205
+ file.create_group("a").unwrap();
206
+ let a = file.group("a").unwrap();
207
+ assert_eq!(a.name(), "/a");
208
+ assert_eq!(a.file().unwrap().id(), file.id());
209
+ assert_eq!(a.refcount(), 1);
210
+ let b = a.clone();
211
+ assert_eq!(b.name(), "/a");
212
+ assert_eq!(b.file().unwrap().id(), file.id());
213
+ assert_eq!(b.refcount(), 2);
214
+ assert_eq!(a.refcount(), 2);
215
+ drop(a);
216
+ assert_eq!(b.refcount(), 1);
217
+ assert!(b.is_valid());
218
+ })
219
+ }
220
+
221
#[test]
222
pub fn test_len() {
223
with_tmp_file(|file| {
0 commit comments