pub struct Namepath { /* private fields */ }
Expand description
Describes the normalized namepath of a TestModule, TestGroup, or Test.
Module and Test reflect their Rust path.
Group uses an arbitrary path.
Components such as ‘::tests’ are removed.
Module: Created using module_path!()
Test: Created using module_path!() and function_name
Group: Created using an arbitrary slash-separated slug (e.g., “foo/hat-cat”)
Implementations§
Source§impl Namepath
impl Namepath
pub fn new_module( package_name: &'static str, use_case: UseCase, module_path: &'static str, ) -> Result<Self>
pub fn new_group( package_name: &'static str, use_case: UseCase, path: &'static str, ) -> Result<Self>
pub fn new_test( package_name: &'static str, use_case: UseCase, module_path: &'static str, function_name: &'static str, ) -> Result<Self>
Sourcepub fn full_path(&self) -> &Path
pub fn full_path(&self) -> &Path
The normalized path, including its package name.
Eg., package-name/use-case/module-path../function-name
pub fn full_path_to_squashed_slug(&self) -> String
Sourcepub fn package_name(&self) -> &str
pub fn package_name(&self) -> &str
The crate name or equivalent
Sourcepub fn kind(&self) -> TestingKind
pub fn kind(&self) -> TestingKind
The kind of testing model this namepath refers to
pub fn use_case(&self) -> UseCase
pub fn raw(&self) -> &RawNamepath
Trait Implementations§
impl Eq for Namepath
impl StructuralPartialEq for Namepath
Auto Trait Implementations§
impl Freeze for Namepath
impl RefUnwindSafe for Namepath
impl Send for Namepath
impl Sync for Namepath
impl Unpin for Namepath
impl UnwindSafe for Namepath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more