mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-24 07:48:04 +03:00
fmt compiler test
This commit is contained in:
parent
b79b961610
commit
ab57ea1d34
@ -106,9 +106,7 @@ fn get_input_file_paths(list: &mut Vec<PathBuf>, test: &Test, input: &Value) {
|
|||||||
for name in seq {
|
for name in seq {
|
||||||
let mut input_file = input_file.clone();
|
let mut input_file = input_file.clone();
|
||||||
input_file.push(name.as_str().expect("input_file was not a string"));
|
input_file.push(name.as_str().expect("input_file was not a string"));
|
||||||
list.push(
|
list.push(input_file.clone());
|
||||||
input_file.clone(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,9 +122,7 @@ fn collect_all_inputs(test: &Test) -> Result<Vec<PathBuf>, String> {
|
|||||||
Ok(list)
|
Ok(list)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compile_and_process<'a>(
|
fn compile_and_process<'a>(parsed: &'a mut Compiler<'a>) -> Result<SymbolTable<'a>, LeoError> {
|
||||||
parsed: &'a mut Compiler<'a>,
|
|
||||||
) -> Result<SymbolTable<'a>, LeoError> {
|
|
||||||
parsed.compiler_stages()
|
parsed.compiler_stages()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,15 +195,12 @@ fn run_test(test: Test, handler: &Handler, err_buf: &BufferEmitter) -> Result<Va
|
|||||||
handler.extend_if_error(parsed.parse_input(input))?;
|
handler.extend_if_error(parsed.parse_input(input))?;
|
||||||
let initial_input_ast = hash_file("/tmp/output/inital_input_ast.json");
|
let initial_input_ast = hash_file("/tmp/output/inital_input_ast.json");
|
||||||
|
|
||||||
output_items.push(OutputItem {
|
output_items.push(OutputItem { initial_input_ast });
|
||||||
initial_input_ast,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let symbol_table = handler.extend_if_error(compile_and_process(&mut parsed))?;
|
let symbol_table = handler.extend_if_error(compile_and_process(&mut parsed))?;
|
||||||
|
|
||||||
|
|
||||||
let initial_ast = hash_file("/tmp/output/initial_ast.json");
|
let initial_ast = hash_file("/tmp/output/initial_ast.json");
|
||||||
|
|
||||||
if fs::read_dir("/tmp/output").is_ok() {
|
if fs::read_dir("/tmp/output").is_ok() {
|
||||||
|
Loading…
Reference in New Issue
Block a user