mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-23 15:15:47 +03:00
add tests
This commit is contained in:
parent
db205441f1
commit
7aa476f320
@ -66,6 +66,7 @@ mod tests {
|
||||
use super::*;
|
||||
use leo_span::symbol::create_session_if_not_set_then;
|
||||
use snarkvm::{prelude::Testnet3, synthesizer::program::Program};
|
||||
use std::fs;
|
||||
|
||||
type CurrentNetwork = Testnet3;
|
||||
|
||||
@ -84,4 +85,14 @@ mod tests {
|
||||
}
|
||||
});
|
||||
}
|
||||
#[test]
|
||||
fn array_test() {
|
||||
create_session_if_not_set_then(|_| {
|
||||
let program_from_file =
|
||||
fs::read_to_string("../tmp/.aleo/registry/testnet3/zk_bitwise_stack_v0_0_2.aleo").unwrap();
|
||||
dbg!(program_from_file.clone());
|
||||
let program = disassemble_from_str(program_from_file).unwrap();
|
||||
dbg!(program);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -371,4 +371,22 @@ mod tests {
|
||||
// Reset $HOME
|
||||
env::set_var("HOME", original_home);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn temp_dir_parent_test() {
|
||||
// Set $HOME to tmp directory so that tests do not modify users real home directory
|
||||
let original_home = env::var("HOME").unwrap();
|
||||
env::set_var("HOME", "../tmp");
|
||||
|
||||
// Test pulling nested dependencies from network
|
||||
const BUILD_DIRECTORY: &str = "../tmp/parent";
|
||||
create_session_if_not_set_then(|_| {
|
||||
let build_dir = PathBuf::from(BUILD_DIRECTORY);
|
||||
let mut retriever = Retriever::new(&build_dir).expect("Failed to build retriever");
|
||||
let _stubs = retriever.retrieve().expect("failed to retrieve");
|
||||
});
|
||||
|
||||
// Reset $HOME
|
||||
env::set_var("HOME", original_home);
|
||||
}
|
||||
}
|
||||
|
10
utils/tmp/.aleo/registry/testnet3/child.aleo
Normal file
10
utils/tmp/.aleo/registry/testnet3/child.aleo
Normal file
@ -0,0 +1,10 @@
|
||||
program child.aleo;
|
||||
|
||||
struct Test:
|
||||
a as u32;
|
||||
b as u32;
|
||||
|
||||
|
||||
function foo:
|
||||
input r0 as Test.private;
|
||||
output r0.a as u32.private;
|
2589
utils/tmp/.aleo/registry/testnet3/zk_bitwise_stack_v0_0_2.aleo
Normal file
2589
utils/tmp/.aleo/registry/testnet3/zk_bitwise_stack_v0_0_2.aleo
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user