#![allow(clippy::assertions_on_constants)]
use std::fmt::Debug;
use tola_caps::std_caps::AutoCaps;
use tola_caps::caps_check;
#[test]
fn test_autocaps_primitives() {
assert!(u32::IS_CLONE);
assert!(u32::IS_COPY);
assert!(u32::IS_DEBUG);
assert!(u32::IS_DEFAULT);
assert!(u32::IS_SEND);
assert!(u32::IS_SYNC);
}
#[test]
fn test_autocaps_bool() {
assert!(bool::IS_CLONE);
assert!(bool::IS_COPY);
}
#[derive(Clone, Debug, Copy)]
struct Copyable;
#[derive(Debug, Clone)]
struct CloneableNotCopy;
#[test]
fn test_caps_check_clone() {
assert!(caps_check!(Copyable: Clone));
assert!(caps_check!(CloneableNotCopy: Clone));
}
#[test]
fn test_caps_check_debug() {
assert!(caps_check!(Copyable: Debug));
assert!(caps_check!(CloneableNotCopy: Debug));
}
#[test]
fn test_caps_check_copy() {
assert!(caps_check!(Copyable: Copy));
assert!(!caps_check!(CloneableNotCopy: Copy));
}
#[test]
fn test_clone_not_copy() {
assert!(caps_check!(CloneableNotCopy: Clone & !Copy));
}