MCPcopy Create free account
hub / github.com/SSheldon/rust-objc / test_class

Function test_class

src/runtime.rs:562–576  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

560
561 #[test]
562 fn test_class() {
563 let cls = test_utils::custom_class();
564 assert!(cls.name() == "CustomObject");
565 assert!(cls.instance_size() > 0);
566 assert!(cls.superclass().is_none());
567
568 assert!(Class::get(cls.name()) == Some(cls));
569
570 let metaclass = cls.metaclass();
571 // The metaclass of a root class is a subclass of the root class
572 assert!(metaclass.superclass().unwrap() == cls);
573
574 let subclass = test_utils::custom_subclass();
575 assert!(subclass.superclass().unwrap() == cls);
576 }
577
578 #[test]
579 fn test_classes() {

Callers

nothing calls this directly

Calls 3

custom_classFunction · 0.85
custom_subclassFunction · 0.85
metaclassMethod · 0.80

Tested by

no test coverage detected