diff --git a/objc-sys/src/lib.rs b/objc-sys/src/lib.rs index 82617ddc8..6e3363235 100644 --- a/objc-sys/src/lib.rs +++ b/objc-sys/src/lib.rs @@ -71,3 +71,18 @@ pub use various::*; /// /// TODO: Replace this with `extern type` to also mark it as `!Sized`. type OpaqueData = PhantomData<(UnsafeCell<()>, *const UnsafeCell<()>, PhantomPinned)>; + +#[cfg(test)] +mod tests { + use super::*; + use std::ffi::CStr; + + #[test] + fn smoke() { + // Verify that this library links and works fine by itself + let name = CStr::from_bytes_with_nul(b"abc:def:\0").unwrap(); + let sel = unsafe { sel_registerName(name.as_ptr()) }; + let rtn = unsafe { CStr::from_ptr(sel_getName(sel)) }; + assert_eq!(name, rtn); + } +}