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

rz-test: Fix last line of diff when REGEXP_FILTER_OUT/_ERR is set #4763

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

kazarmy
Copy link
Member

@kazarmy kazarmy commented Dec 11, 2024

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

This pr fixes the last line of the diff when REGEXP_FILTER_OUT/_ERR is set (example problem shown below) by adding a newline as appropriate.

debug_dmh

The following changes to tests were used for testing:

diff --git a/test/db/archos/linux-x64/dbg_afvd b/test/db/archos/linux-x64/dbg_afvd
index 84a16a4c4e..7a19405eac 100644
--- a/test/db/archos/linux-x64/dbg_afvd
+++ b/test/db/archos/linux-x64/dbg_afvd
@@ -10,6 +10,7 @@ afvd var_ch
 EOF
 REGEXP_FILTER_OUT=('.'\s*)
 EXPECT=<<EOF
+'b'
 'a'
 EOF
 RUN
diff --git a/test/db/archos/linux-x64/dbg_dmh b/test/db/archos/linux-x64/dbg_dmh
index 5e46cfd6c8..eccc3c3c57 100644
--- a/test/db/archos/linux-x64/dbg_dmh
+++ b/test/db/archos/linux-x64/dbg_dmh
@@ -33,7 +33,7 @@ size=0xf160
 status=allocated
 size=0x11c10
 status=allocated
-size=0x20
+size=0x2
 status=free
 size=0xf140
 EOF
diff --git a/test/db/archos/linux-x64/dbg_oo b/test/db/archos/linux-x64/dbg_oo
index 9b2d83e4de..514368331d 100644
--- a/test/db/archos/linux-x64/dbg_oo
+++ b/test/db/archos/linux-x64/dbg_oo
@@ -114,7 +114,7 @@ ood
 EOF
 REGEXP_FILTER_ERR=(Process\swith\sPID)|(helloworld-gcc\sreopened\sin\sread-write\smode)
 EXPECT_ERR=<<EOF
-Process with PID
+Proce with PID
 helloworld-gcc reopened in read-write mode
 EOF
 RUN
diff --git a/test/db/archos/linux-x64/dbg_trace b/test/db/archos/linux-x64/dbg_trace
index 3f11dc724d..50848da7a3 100644
--- a/test/db/archos/linux-x64/dbg_trace
+++ b/test/db/archos/linux-x64/dbg_trace
@@ -71,5 +71,7 @@ main+8
 entry0+41
 EOF
 REGEXP_FILTER_ERR=ERROR.*\n
-EXPECT_ERR=
+EXPECT_ERR=<<EOF
+abc
+EOF
 RUN

Test plan

Manual testing is needed. All builds are green.

Closing issues

...

@kazarmy kazarmy merged commit 925e2e9 into rizinorg:dev Dec 14, 2024
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants