bench = false
doc = false
+[[test]]
+name = "simple"
+path = "tests/simple/main.rs"
+test = true
+required-features = [ "anyhow", "test-harness" ]
+
[dependencies]
bitflags = "1.2.1"
endian_trait = { version = "0.6", features = ["arrays"] }
"tokio/macros",
]
+test-harness = []
+
[dev-dependencies]
libc = "0.2"
anyhow = "1.0"
pub const NO_MASK: Permissions = Permissions(NO_MASK);
}
-#[derive(Clone, Debug, Endian, Eq)]
+#[derive(Clone, Debug, Endian, Eq, PartialEq)]
#[repr(C)]
pub struct User {
pub uid: u64,
}
}
-impl PartialEq for User {
- fn eq(&self, other: &User) -> bool {
- self.uid == other.uid && self.permissions == other.permissions
- }
-}
-
-#[derive(Clone, Debug, Endian, Eq)]
+#[derive(Clone, Debug, Endian, Eq, PartialEq)]
#[repr(C)]
pub struct Group {
pub gid: u64,
}
}
-impl PartialEq for Group {
- fn eq(&self, other: &Group) -> bool {
- self.gid == other.gid && self.permissions == other.permissions
- }
-}
-
-#[derive(Clone, Debug, Endian)]
+#[derive(Clone, Debug, Endian, Eq, PartialEq)]
#[repr(C)]
pub struct GroupObject {
pub permissions: Permissions,
}
#[derive(Clone, Debug, Endian)]
+#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
#[repr(C)]
pub struct Default {
pub user_obj_permissions: Permissions,
}
#[derive(Clone, Debug, Default, Endian)]
+#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
#[repr(C)]
pub struct Entry {
pub mode: u64,
}
}
-#[derive(Clone, Debug, Endian)]
+#[derive(Clone, Debug, Endian, Eq, PartialEq)]
#[repr(C)]
pub struct Device {
pub major: u64,
}
#[derive(Clone, Debug)]
+#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
#[repr(C)]
pub struct FCaps {
pub data: Vec<u8>,
}
-#[derive(Clone, Copy, Debug, Endian)]
+#[derive(Clone, Copy, Debug, Endian, Eq, PartialEq)]
#[repr(C)]
pub struct QuotaProjectId {
pub projid: u64,
/// This includes the usual data you'd get from `stat()` as well as ACLs, extended attributes, file
/// capabilities and more.
#[derive(Clone, Debug, Default)]
+#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
pub struct Metadata {
/// Data typically found in a `stat()` call.
pub stat: Stat,
///
/// This contains all the various ACL entry types supported by the pxar archive format.
#[derive(Clone, Debug, Default)]
+#[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))]
pub struct Acl {
/// User ACL list.
pub users: Vec<format::acl::User>,