mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 05:48:31 +00:00
Pass case_index through Case trait
This commit is contained in:
@@ -22,7 +22,11 @@ pub use ssz_generic::*;
|
||||
pub use ssz_static::*;
|
||||
|
||||
pub trait Case {
|
||||
fn result(&self) -> Result<(), Error>;
|
||||
/// Execute a test and return the result.
|
||||
///
|
||||
/// `case_index` reports the index of the case in the set of test cases. It is not strictly
|
||||
/// necessary, but it's useful when troubleshooting specific failing tests.
|
||||
fn result(&self, case_index: usize) -> Result<(), Error>;
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -38,7 +42,7 @@ where
|
||||
self.test_cases
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(i, tc)| CaseResult::new(i, tc, tc.result()))
|
||||
.map(|(i, tc)| CaseResult::new(i, tc, tc.result(i)))
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user