add tests

This commit is contained in:
evan-schott 2023-12-04 17:15:51 -08:00
parent db205441f1
commit 7aa476f320
4 changed files with 2628 additions and 0 deletions

View File

@ -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);
});
}
}

View File

@ -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);
}
}

View 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;

File diff suppressed because it is too large Load Diff