Fix overescaping of quote to fix warning with gawk 5.0.1#70
Fix overescaping of quote to fix warning with gawk 5.0.1#70pbrisbin merged 2 commits intopbrisbin:masterfrom
Conversation
|
Hey there- I'm a bot, here to let you know that some code in this PR might not Please see that Pull Request's description for more details. |
|
Thank you very much! I do hope that This fix looks good to me, but would you be able to add a test case for it? I think adding a case to the |
|
Thank you for the quick reply, but I am not really sure about the tests here, or how you would do them. I initially thought how you would write a test for that. Unfortunately I do not really know The commit which is responsible for the behavior of I.e. the functionality is not changed, but just a warning is added, both versions seem to work just fine, i.e.: $ awk '{ gsub(/\\"/, "\""); print; print "" }'
\"
"
"
"
\\"
\"$ awk '{ gsub(/\\\"/, "\""); print; print "" }'
awk: cmd:1: Warning: regexp escape sequence `\"' is not a known regexp operator
\"
"
"
"
\\"
\"The warning is shown in every action where the search is used, i.e. |
Did you look at the Now that you asked, here are more details: To test this, I would add a new case that searches for a package that we know includes a diff --git i/test/search.t w/test/search.t
index 42325e0..7253e73 100644
--- i/test/search.t
+++ w/test/search.t
@@ -79,3 +79,7 @@ Searching for info on chruby and aurget
Votes : 21
Description : Changes the current ruby. Supports both zsh and bash.
+
+Searching for info with "s
+
+ $ aurget -Ssi --nocolor 3dsconvIf you checkout % cram -i test/search.t
!
--- search.t
+++ search.t.err
@@ -83,3 +83,11 @@
Searching for info with "s
$ aurget -Ssi --nocolor 3dsconv
+ Repository : aur
+ Name : 3dsconv
+ Version : 4.1-0
+ URL : https://github.com/ihaveamac/3dsconv
+ Out of date : Yes
+ Votes : 2
+ Description : Tool to convert Nintendo 3DS CTR Cart Image files (CCI, ".3ds") to the CTR Importable Archive format (CIA).
+
Accept this change? [yN]It my case, it seems I don't have the Now, you would Accept that, but then manually change the test to remove the warning since that's what you are trying to make happen. At that point, the test should fail. Apply your fix and confirm it passes! In addition to asserting the warning is not seen, this test also asserts quotes are handled correctly generally. NOTE: this will create a file at Hope that made sense! |
|
Yup, I looked at the tests, and especially the The problem is, that I am not sure how one want to test this particular issue. Since the warning is only shown when you have I quickly looked through the python Docker images, the only distribution which should have yield the error is All the other images still have some a version of The code, and therefore the warning is displayed for every search action performed, since the regex is applied no matter if there is a match or not (even Therefore I meant to really test this, one would need to also change the test setup and so on. Do you think this is a reasonable thing to do? If this is really needed, I will look into how to restructure the test setup. But this will take some days I guess. Or would one want to compile gawk on the docker image itself, and then compare the two versions? The behavior itself is not changed, since the old version also works, i.e. the following is correctly displayed: $ aurget -Ss 3dsconv
awk: cmd:4: Warning: regexp escape sequence `\"' is not a known regexp operator
aur/3dsconv 4.1-0 [out of date]
Tool to convert Nintendo 3DS CTR Cart Image files (CCI, ".3ds") to the CTR Importable Archive format (CIA).
aur/3dsconv-git r83.00a95c3-1 [out of date]
Tool to convert Nintendo 3DS CTR Cart Image files (CCI, ".3ds") to the CTR Importable Archive format (CIA). |
|
Ah, gotcha. Sorry about the confusion.
I don't think we need to get crazy rigorous here. And since you've identified complexity in doing so, I would actually recommend against it. All I need to accept this PR is a test confirming this change doesn't break existing quote handling (regardless of It would be nice to have a test that actually validates your fix by ensuring warnings aren't visible in the newer |
|
I added the test case, as you suggested. Furthermore I noticed #73 where a different approach was chosen, i.e. replacing the |
347f082 to
d28845e
Compare
d28845e to
ca877df
Compare
|
Thanks! Going to merge this and then ask in the other PR if/why it might be better. |
Although I just noticed that you will be sunsetting
aurget, I want to open this pull request, to fix anawkwarning from the update ofgawkto version 5.0.1.I understand the reasoning why you are sunsetting
aurget(especially since you do not use it yourself), my reason to use it, is because of its simplicity and I never had any issues :-) just for your information.Thank you very much for your work so far.