Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Add tests that exercise operator choice in classic run
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Aug 4, 2023
1 parent d87b380 commit 99b4ead
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/tests/classic/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1199,3 +1199,34 @@ fn test_secp256r1_verify_classic_fail() {
.to_string();
assert!(output.starts_with("FAIL: secp256r1_verify failed"));
}

#[test]
fn test_classic_obeys_operator_choice_at_compile_time_no_version() {
let compiled = do_basic_run(&vec![
"run".to_string(),
"(mod () (coinid (sha256 99) (sha256 99) 1))".to_string()
]).trim().to_string();
assert_eq!(compiled, "(q . 0x97c3f14ced4dfc280611fd8d9b158163e8981b3bce4d1bb6dd0bcc679a2e2455)");
}

#[test]
fn test_classic_obeys_operator_choice_at_compile_time_version_1() {
let compiled = do_basic_run(&vec![
"run".to_string(),
"--operators-version".to_string(),
"1".to_string(),
"(mod () (coinid (sha256 99) (sha256 99) 1))".to_string()
]).trim().to_string();
assert_eq!(compiled, "(q . 0x97c3f14ced4dfc280611fd8d9b158163e8981b3bce4d1bb6dd0bcc679a2e2455)");
}

#[test]
fn test_classic_obeys_operator_choice_at_compile_time_version_0() {
let compiled = do_basic_run(&vec![
"run".to_string(),
"--operators-version".to_string(),
"0".to_string(),
"(mod () (coinid (sha256 99) (sha256 99) 1))".to_string()
]).trim().to_string();
assert_eq!(compiled, "FAIL: unimplemented operator 48");
}

0 comments on commit 99b4ead

Please sign in to comment.