Skip to content

Commit ae64f29

Browse files
committed
Add fontfuncs test
1 parent 6933a8c commit ae64f29

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

crates/bridge_harfbuzz/src/font_funcs.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,3 +495,24 @@ unsafe impl<T: Send> Send for ImmutFontFuncs<T> {}
495495
// reference from other threads. The contained data isn't bound because it is tied to the font,
496496
// which is not Send or Sync and as such will not use the data across threads.
497497
unsafe impl<T: Sync> Sync for ImmutFontFuncs<T> {}
498+
499+
#[cfg(test)]
500+
mod tests {
501+
use super::*;
502+
503+
#[test]
504+
fn test_clone_drop() {
505+
let funcs = FontFuncs::<()>::default();
506+
let f2 = funcs.clone();
507+
508+
assert_eq!(f2.0, funcs.0);
509+
510+
let f2 = f2.make_immutable();
511+
let f3 = f2.clone();
512+
513+
assert_eq!(f2.0, f3.0);
514+
515+
drop(funcs);
516+
drop(f2);
517+
}
518+
}

0 commit comments

Comments
 (0)