mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 12:28:24 +00:00
Re-organise ef_tests
This commit is contained in:
@@ -2,6 +2,7 @@ use ef_tests::*;
|
||||
use serde::de::DeserializeOwned;
|
||||
use std::{fs::File, io::prelude::*, path::PathBuf};
|
||||
|
||||
/*
|
||||
fn load_test_case<T: DeserializeOwned>(test_name: &str) -> TestDoc<T> {
|
||||
let mut file = {
|
||||
let mut file_path_buf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
@@ -23,10 +24,34 @@ fn ssz_generic() {
|
||||
|
||||
let results = doc.test();
|
||||
|
||||
let failures: Vec<&TestCaseResult<SszGeneric>> =
|
||||
results.iter().filter(|r| r.result.is_err()).collect();
|
||||
let failures: Vec<&TestCaseResult> = results.iter().filter(|r| r.result.is_err()).collect();
|
||||
|
||||
if !failures.is_empty() {
|
||||
panic!("{:?}", failures);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
fn test_file(trailing_path: &str) -> PathBuf {
|
||||
let mut file_path_buf = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
file_path_buf.push(format!("eth2.0-spec-tests/tests/{}", trailing_path));
|
||||
|
||||
file_path_buf
|
||||
}
|
||||
|
||||
mod ssz_generic {
|
||||
use super::*;
|
||||
|
||||
fn ssz_generic_file(file: &str) -> PathBuf {
|
||||
let mut path = test_file("ssz_generic");
|
||||
path.push(file);
|
||||
dbg!(&path);
|
||||
|
||||
path
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn uint_bounds() {
|
||||
TestDoc::assert_tests_pass(ssz_generic_file("uint/uint_bounds.yaml"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user