Skip to content

Commit

Permalink
investigate!
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Nov 1, 2021
1 parent 2fb4fb8 commit e1cd54f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion objc2_foundation/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ unsafe impl<T: 'static> INSCopying for NSValue<T> {
#[cfg(test)]
mod tests {
use crate::{INSValue, NSRange, NSValue};
use objc2::Encode;
use objc2::{msg_send, runtime::Object, Encode};

#[test]
fn test_value() {
Expand All @@ -98,6 +98,15 @@ mod tests {
fn test_value_nsrange() {
let val = NSValue::new(NSRange::from(1..2));
assert!(&NSRange::ENCODING == val.encoding().unwrap());
#[cfg(gnustep)]
assert_eq!(
unsafe { &*(&*val as *const NSValue<NSRange> as *const Object) }
.class()
.name(),
"GSRangeValue"
);
let range: NSRange = unsafe { msg_send![val, rangeValue] };
assert_eq!(range, NSRange::from(1..2));
assert_eq!(val.get(), NSRange::from(1..2));
}
}

0 comments on commit e1cd54f

Please sign in to comment.