Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 0 additions & 17 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion compiler/noirc_evaluator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ similar-asserts.workspace = true
tracing-test = "0.2.5"
num-traits.workspace = true
test-case.workspace = true
function_name = "0.3.0"
insta.workspace = true
noirc_frontend = { workspace = true, features = ["test_utils"] }

Expand Down
18 changes: 6 additions & 12 deletions compiler/noirc_evaluator/src/ssa/ssa_gen/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ use crate::{errors::RuntimeError, ssa::opt::assert_normalized_ssa_equals};

use super::{Ssa, generate_ssa};

use function_name::named;
use noirc_frontend::test_utils::get_monomorphized;

use noirc_frontend::function_path;
use noirc_frontend::test_utils::{Expect, get_monomorphized};

fn get_initial_ssa(src: &str, test_path: &str) -> Result<Ssa, RuntimeError> {
let program = match get_monomorphized(src, Some(test_path), Expect::Success) {
fn get_initial_ssa(src: &str) -> Result<Ssa, RuntimeError> {
let program = match get_monomorphized(src) {
Ok(program) => program,
Err(errors) => {
panic!(
Expand All @@ -22,15 +19,14 @@ fn get_initial_ssa(src: &str, test_path: &str) -> Result<Ssa, RuntimeError> {
generate_ssa(program)
}

#[named]
#[test]
fn assert() {
let assert_src = "
fn main(input: u32) {
assert(input == 5);
}
";
let assert_ssa = get_initial_ssa(assert_src, function_path!()).unwrap();
let assert_ssa = get_initial_ssa(assert_src).unwrap();

let expected = "
acir(inline) fn main f0 {
Expand All @@ -43,7 +39,6 @@ fn assert() {
assert_normalized_ssa_equals(assert_ssa, expected);
}

#[named]
#[test]
fn assert_eq() {
let assert_eq_src = "
Expand All @@ -52,7 +47,7 @@ fn assert_eq() {
}
";

let assert_eq_ssa = get_initial_ssa(assert_eq_src, function_path!()).unwrap();
let assert_eq_ssa = get_initial_ssa(assert_eq_src).unwrap();

let expected = "
acir(inline) fn main f0 {
Expand All @@ -67,7 +62,6 @@ fn assert_eq() {
assert_normalized_ssa_equals(assert_eq_ssa, expected);
}

#[named]
#[test]
fn basic_loop() {
let src = "
Expand All @@ -80,7 +74,7 @@ fn basic_loop() {
}
";

let ssa = get_initial_ssa(src, function_path!()).unwrap();
let ssa = get_initial_ssa(src).unwrap();

let expected = "
acir(inline) fn main f0 {
Expand Down
1 change: 0 additions & 1 deletion compiler/noirc_frontend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ fxhash.workspace = true

[dev-dependencies]
base64.workspace = true
function_name = "0.3.0"
proptest.workspace = true
proptest-derive.workspace = true
insta.workspace = true
Expand Down
4 changes: 0 additions & 4 deletions compiler/noirc_frontend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
// Temporary allows.
#![allow(clippy::mutable_key_type, clippy::result_large_err)]

#[cfg(test)]
#[macro_use]
extern crate function_name;

pub mod ast;
pub mod debug;
pub mod elaborator;
Expand Down
17 changes: 3 additions & 14 deletions compiler/noirc_frontend/src/monomorphization/tests.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#![cfg(test)]
use crate::{
check_monomorphization_error_using_features, elaborator::UnstableFeature, test_utils::Expect,
check_monomorphization_error_using_features, elaborator::UnstableFeature,
test_utils::get_monomorphized,
};

// NOTE: this will fail in CI when called twice within one test: test names must be unique
#[macro_export]
macro_rules! get_monomorphized {
($src:expr, $expect:expr) => {
$crate::test_utils::get_monomorphized($src, Some($crate::function_path!()), $expect)
};
}

// NOTE: this will fail in CI when called twice within one test: test names must be unique
#[macro_export]
macro_rules! check_rewrite {
Expand All @@ -19,7 +12,6 @@ macro_rules! check_rewrite {
};
}

#[named]
#[test]
fn bounded_recursive_type_errors() {
// We want to eventually allow bounded recursive types like this, but for now they are
Expand All @@ -43,7 +35,6 @@ fn bounded_recursive_type_errors() {
check_monomorphization_error_using_features!(src, &features);
}

#[named]
#[test]
fn recursive_type_with_alias_errors() {
// We want to eventually allow bounded recursive types like this, but for now they are
Expand Down Expand Up @@ -79,7 +70,6 @@ fn recursive_type_with_alias_errors() {
check_monomorphization_error_using_features!(src, &features);
}

#[named]
#[test]
fn mutually_recursive_types_error() {
// cSpell:disable
Expand All @@ -105,7 +95,6 @@ fn mutually_recursive_types_error() {
check_monomorphization_error_using_features!(src, &features);
}

#[named]
#[test]
fn simple_closure_with_no_captured_variables() {
let src = r#"
Expand All @@ -116,7 +105,7 @@ fn simple_closure_with_no_captured_variables() {
}
"#;

let program = get_monomorphized!(src, Expect::Success).unwrap();
let program = get_monomorphized(src).unwrap();
insta::assert_snapshot!(program, @r"
fn main$f0(y$l0: call_data(0) Field) -> pub Field {
let x$l1 = 1;
Expand Down
Loading
Loading