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

Incorrect fnmatch due to extended glob syntax #758

Closed
andychu opened this issue May 19, 2020 · 4 comments
Closed

Incorrect fnmatch due to extended glob syntax #758

andychu opened this issue May 19, 2020 · 4 comments

Comments

@andychu
Copy link
Contributor

andychu commented May 19, 2020

Does not match the pattern with parentheses.

$ ~/git/oil/bin/osh -c 'case "foo()" in *\(\)) echo "should be match"; esac'
$ dash -c 'case "foo()" in *\(\)) echo "should be match"; esac'
should be match

Originally posted by @ko1nksm in #752 (comment)

andychu pushed a commit that referenced this issue May 21, 2020
Still need to fix the bug.  And this makes the extglob-match suite fail.
Gah.
andychu pushed a commit that referenced this issue May 21, 2020
Addresses issue #758.

Documented the difference between extglob in bash and Oil.
@andychu
Copy link
Contributor Author

andychu commented May 26, 2020

Released: http://www.oilshell.org/blog/2020/05/translation-progress.html

@andychu andychu closed this as completed May 26, 2020
@abathur
Copy link
Collaborator

abathur commented Feb 27, 2021

When I was updating to 0.8.7, I also noticed a new test break that appears to be introduced with the tests in 61675c2 and not resolved by the fix in ee59db8. I assume, since I don't see other threads, that this is just on macOS (but haven't tried this on linux). Mainly mentioning it for searchability later :)

======================================================================
FAIL: testFnmatchExtglob (__main__.LibcTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "native/libc_test.py", line 110, in testFnmatchExtglob
    (pat, s, actual, expected))
AssertionError: Matching --@(help|verbose) against --verbose: got 0 but expected 1

----------------------------------------------------------------------

There ended up being several of these tests to patch out

@andychu
Copy link
Contributor Author

andychu commented Feb 28, 2021

Thanks for the report, this is actually #612 which is still open

@abathur
Copy link
Collaborator

abathur commented Feb 28, 2021

Aha :)

Want me to delete the comment here and repost there? I landed here because I manually ~bisected the breaks to starting at 61675c2 and it pointed back here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants