Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] fix testing failures relate to 0x0x #31

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn call_non_existent_function() {
let code = r#"
module {{ADDR}}::M {}
"#;
let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));

let mut units = compile_units(&code).unwrap();
let m = as_module(units.pop().unwrap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn test_malformed_resource() {
}
}
"#;
let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));
let mut units = compile_units(&code).unwrap();

let s2 = as_script(units.pop().unwrap());
Expand Down Expand Up @@ -160,7 +160,7 @@ fn test_malformed_module() {
}
"#;

let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));
let mut units = compile_units(&code).unwrap();

let m = as_module(units.pop().unwrap());
Expand Down Expand Up @@ -214,7 +214,7 @@ fn test_unverifiable_module() {
}
"#;

let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));
let mut units = compile_units(&code).unwrap();
let m = as_module(units.pop().unwrap());

Expand Down Expand Up @@ -273,7 +273,7 @@ fn test_missing_module_dependency() {
public fun bar() { M::foo(); }
}
"#;
let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));
let mut units = compile_units(&code).unwrap();
let n = as_module(units.pop().unwrap());
let m = as_module(units.pop().unwrap());
Expand Down Expand Up @@ -320,7 +320,7 @@ fn test_missing_module_dependency() {
}

#[test]
fn test_malformed_module_denpency() {
fn test_malformed_module_dependency() {
// Compile two modules M, N where N depends on M.
let code = r#"
module {{ADDR}}::M {
Expand All @@ -333,7 +333,7 @@ fn test_malformed_module_denpency() {
public fun bar() { M::foo(); }
}
"#;
let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));
let mut units = compile_units(&code).unwrap();
let n = as_module(units.pop().unwrap());
let m = as_module(units.pop().unwrap());
Expand Down Expand Up @@ -399,7 +399,7 @@ fn test_unverifiable_module_dependency() {
public fun bar() { M::foo(); }
}
"#;
let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));
let mut units = compile_units(&code).unwrap();
let n = as_module(units.pop().unwrap());
let m = as_module(units.pop().unwrap());
Expand Down Expand Up @@ -534,7 +534,7 @@ fn test_storage_returns_bogus_error_when_loading_resource() {
}
}
"#;
let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));

let mut units = compile_units(&code).unwrap();
let m = as_module(units.pop().unwrap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn run(

let code = format!(
r#"
module 0x{}::M {{
module {}::M {{
struct Foo has copy, drop {{ x: u64 }}
struct Bar<T> has copy, drop {{ x: T }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn mutated_accounts() {
}
"#;

let code = code.replace("{{ADDR}}", &format!("0x{}", TEST_ADDR.to_string()));
let code = code.replace("{{ADDR}}", &format!("{}", TEST_ADDR));
let mut units = compile_units(&code).unwrap();
let m = as_module(units.pop().unwrap());
let mut blob = vec![];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn run(

let code = format!(
r#"
module 0x{}::M {{
module {}::M {{
{}

fun foo{} {{
Expand Down