pub struct TestRegistration { /* private fields */ }Implementations§
Source§impl TestRegistration
impl TestRegistration
pub fn title(&self) -> &str
Sourcepub fn canonical_name(&self) -> &str
pub fn canonical_name(&self) -> &str
Examples found in repository?
examples/example_smoke.rs (line 23)
5fn main() {
6 let tests = collect_tests(|| {
7 describe!("math", {
8 test!("adds two numbers", |ctx| {
9 ctx.stdout("ok\n");
10 expect(2 + 3).to_be(5);
11 });
12
13 test!("handles negatives", id = "math/handles-negatives", |ctx| {
14 assert!(ctx.observe().metric("wall_time_ns", 42.0));
15 expect(-2 + 1).to_be(-1);
16 });
17 });
18 })
19 .expect("collection should validate");
20
21 for test in &tests {
22 let outcome = run_test(test);
23 println!("{} => {}", test.canonical_name(), outcome.exit);
24 }
25}pub fn target(&self) -> &str
pub fn suite_path(&self) -> &[String]
Trait Implementations§
Source§impl Clone for TestRegistration
impl Clone for TestRegistration
Source§fn clone(&self) -> TestRegistration
fn clone(&self) -> TestRegistration
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TestRegistration
impl RefUnwindSafe for TestRegistration
impl Send for TestRegistration
impl Sync for TestRegistration
impl Unpin for TestRegistration
impl UnsafeUnpin for TestRegistration
impl UnwindSafe for TestRegistration
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