From e59661262bbfa61f85ab19f80eef0e8ebdc0d007 Mon Sep 17 00:00:00 2001 From: "Michael J. Klein" Date: Fri, 11 Oct 2024 16:20:47 +0100 Subject: [PATCH 1/3] chore: regression test for #5462 --- .../execution_success/regression_test_5462/Nargo.toml | 7 +++++++ .../regression_test_5462/src/main.nr | 11 +++++++++++ .../execution_success/slice_regex/src/main.nr | 6 ++++-- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 test_programs/execution_success/regression_test_5462/Nargo.toml create mode 100644 test_programs/execution_success/regression_test_5462/src/main.nr diff --git a/test_programs/execution_success/regression_test_5462/Nargo.toml b/test_programs/execution_success/regression_test_5462/Nargo.toml new file mode 100644 index 00000000000..3ee6ff31479 --- /dev/null +++ b/test_programs/execution_success/regression_test_5462/Nargo.toml @@ -0,0 +1,7 @@ +[package] +name = "regression_test_5462" +type = "bin" +authors = [""] +compiler_version = ">=0.35.0" + +[dependencies] \ No newline at end of file diff --git a/test_programs/execution_success/regression_test_5462/src/main.nr b/test_programs/execution_success/regression_test_5462/src/main.nr new file mode 100644 index 00000000000..098dc88361f --- /dev/null +++ b/test_programs/execution_success/regression_test_5462/src/main.nr @@ -0,0 +1,11 @@ +fn main() { + let empty_slice: [u8] = &[]; + + if empty_slice != &[] { + let _ = empty_slice.pop_front(); + } + + if empty_slice.len() != 0 { + let _ = empty_slice.pop_front(); + } +} diff --git a/test_programs/execution_success/slice_regex/src/main.nr b/test_programs/execution_success/slice_regex/src/main.nr index 15768248473..3b860839a6e 100644 --- a/test_programs/execution_success/slice_regex/src/main.nr +++ b/test_programs/execution_success/slice_regex/src/main.nr @@ -208,7 +208,7 @@ fn main() { let result = three_ones_regex.match("1111".as_bytes().as_slice()); println(result); assert_eq(result, Match { succeeded: true, match_ends: 3, leftover: &[] }); - // TODO(https://github.com/noir-lang/noir/issues/5462): re-enable these cases and complete the test using array_regex below + // TODO(https://github.com/noir-lang/noir/issues/6285): re-enable these cases and complete the test using array_regex below // // // 1* // let ones_regex: Star, 5> = Star { inner: "1" }; @@ -279,7 +279,9 @@ fn main() { // }); } -// array_regex: use to complete test once https://github.com/noir-lang/noir/issues/5462 is resolved +// TODO +// array_regex execution_success test: +// use to complete test once https://github.com/noir-lang/noir/issues/6285 is resolved // // // offset <= len <= N // struct Bvec { From f23934a83feec5be48411f7b4a798f2712dbe5f3 Mon Sep 17 00:00:00 2001 From: "Michael J. Klein" Date: Fri, 11 Oct 2024 16:26:58 +0100 Subject: [PATCH 2/3] nargo fmt --- .../execution_success/regression_test_5462/src/main.nr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_programs/execution_success/regression_test_5462/src/main.nr b/test_programs/execution_success/regression_test_5462/src/main.nr index 098dc88361f..092f7ab96a5 100644 --- a/test_programs/execution_success/regression_test_5462/src/main.nr +++ b/test_programs/execution_success/regression_test_5462/src/main.nr @@ -1,10 +1,10 @@ fn main() { let empty_slice: [u8] = &[]; - + if empty_slice != &[] { let _ = empty_slice.pop_front(); } - + if empty_slice.len() != 0 { let _ = empty_slice.pop_front(); } From 6fa768540e7528ccb946d76ce42228a9acb3a44a Mon Sep 17 00:00:00 2001 From: "Michael J. Klein" Date: Fri, 11 Oct 2024 17:52:12 +0100 Subject: [PATCH 3/3] rename regression_test_5462 -> regression_5462 --- .../{regression_test_5462 => regression_5462}/Nargo.toml | 4 ++-- .../{regression_test_5462 => regression_5462}/src/main.nr | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename test_programs/execution_success/{regression_test_5462 => regression_5462}/Nargo.toml (61%) rename test_programs/execution_success/{regression_test_5462 => regression_5462}/src/main.nr (100%) diff --git a/test_programs/execution_success/regression_test_5462/Nargo.toml b/test_programs/execution_success/regression_5462/Nargo.toml similarity index 61% rename from test_programs/execution_success/regression_test_5462/Nargo.toml rename to test_programs/execution_success/regression_5462/Nargo.toml index 3ee6ff31479..97015f78963 100644 --- a/test_programs/execution_success/regression_test_5462/Nargo.toml +++ b/test_programs/execution_success/regression_5462/Nargo.toml @@ -1,7 +1,7 @@ [package] -name = "regression_test_5462" +name = "regression_5462" type = "bin" authors = [""] compiler_version = ">=0.35.0" -[dependencies] \ No newline at end of file +[dependencies] diff --git a/test_programs/execution_success/regression_test_5462/src/main.nr b/test_programs/execution_success/regression_5462/src/main.nr similarity index 100% rename from test_programs/execution_success/regression_test_5462/src/main.nr rename to test_programs/execution_success/regression_5462/src/main.nr