Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_failure/regression_8229/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/as_witness/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/databus/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/derive/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/diamond_deps_0/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/function_ref/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/hash_to_field/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/hashmap/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/main_return/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions test_programs/execution_success/prelude/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions test_programs/execution_success/regression_3051/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_3394/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_3889/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_6834/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_7128/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_7143/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_7962/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_8009/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_8011/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_8235/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_8236/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_8261/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/regression_8329/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/return_twice/stdout.txt

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/simple_bitwise/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/simple_mut/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/simple_not/stdout.txt

This file was deleted.

2 changes: 0 additions & 2 deletions test_programs/execution_success/simple_print/stdout.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/slice_coercion/stdout.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/struct_inputs/stdout.txt

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/tuple_inputs/stdout.txt

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion test_programs/execution_success/wildcard_type/stdout.txt

This file was deleted.

This file was deleted.

35 changes: 9 additions & 26 deletions tooling/nargo_cli/tests/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
}

// Enable enums and ownership as unstable features
nargo.arg("-Zenums");

Check warning on line 63 in tooling/nargo_cli/tests/execute.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (Zenums)

if force_brillig.0 {
{
Expand Down Expand Up @@ -149,32 +149,15 @@
let stdout = String::from_utf8(output.stdout).unwrap();
let stdout = remove_noise_lines(stdout);

let stdout_path = test_program_dir.join("stdout.txt");
let expected_stdout = if stdout_path.exists() {
String::from_utf8(fs::read(stdout_path.clone()).unwrap()).unwrap()
} else {
String::new()
};

// Remove any trailing newlines added by some editors
let stdout = stdout.trim();
let expected_stdout = expected_stdout.trim();

if stdout != expected_stdout {
if std::env::var("OVERWRITE_TEST_OUTPUT").is_ok() {
fs::write(stdout_path, stdout.to_string() + "\n").unwrap();
} else {
println!(
"stdout does not match expected output. Expected:\n{expected_stdout}\n\nActual:\n{stdout}"
);
if expected_stdout.is_empty() && !stdout_path.exists() {
println!(
"Hint: set the OVERWRITE_TEST_OUTPUT env var to establish a stdout.txt"
)
}
assert_eq!(stdout, expected_stdout);
}
}
let test_name = test_program_dir.file_name().unwrap().to_string_lossy().to_string();
let snapshot_name = "stdout";
insta::with_settings!(
{
snapshot_path => format!("./snapshots/execution_success/{test_name}")
},
{
insta::assert_snapshot!(snapshot_name, stdout)
})
}

check_program_artifact(
Expand Down Expand Up @@ -324,7 +307,7 @@
nargo.arg("execute").arg("--force").arg("--disable-comptime-printing");

// Enable enums as an unstable feature
nargo.arg("-Zenums");

Check warning on line 310 in tooling/nargo_cli/tests/execute.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (Zenums)

// Enable pedantic solving
nargo.arg("--pedantic-solving");
Expand All @@ -339,7 +322,7 @@
nargo.arg("expand").arg("--force").arg("--disable-comptime-printing");

// Enable enums as an unstable feature
nargo.arg("-Zenums");

Check warning on line 325 in tooling/nargo_cli/tests/execute.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (Zenums)

// Enable pedantic solving
nargo.arg("--pedantic-solving");
Expand All @@ -363,7 +346,7 @@
let temp_dir = tempfile::tempdir().unwrap().into_path();

// Copy everything from the original directory to the new directory
// (because some depdendencies might be there and might be needed for the expanded code to work)

Check warning on line 349 in tooling/nargo_cli/tests/execute.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (depdendencies)
copy_dir_all(test_program_dir.clone(), temp_dir.clone()).unwrap();

// Create a main file for the expanded code
Expand All @@ -378,7 +361,7 @@
nargo.arg("execute").arg("--force").arg("--disable-comptime-printing");

// Enable enums as an unstable feature
nargo.arg("-Zenums");

Check warning on line 364 in tooling/nargo_cli/tests/execute.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (Zenums)

// Enable pedantic solving
nargo.arg("--pedantic-solving");
Expand All @@ -400,7 +383,7 @@
nargo.arg("expand").arg("--force").arg("--disable-comptime-printing");

// Enable enums as an unstable feature
nargo.arg("-Zenums");

Check warning on line 386 in tooling/nargo_cli/tests/execute.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (Zenums)

// Enable pedantic solving
nargo.arg("--pedantic-solving");
Expand All @@ -424,7 +407,7 @@
let temp_dir = tempfile::tempdir().unwrap().into_path();

// Copy everything from the original directory to the new directory
// (because some depdendencies might be there and might be needed for the expanded code to work)

Check warning on line 410 in tooling/nargo_cli/tests/execute.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (depdendencies)
copy_dir_all(test_program_dir.clone(), temp_dir.clone()).unwrap();

// Create a main file for the expanded code
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading