Skip to content

Add test for forward-sexp-function #1151

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

Merged
merged 1 commit into from
Feb 13, 2016
Merged

Add test for forward-sexp-function #1151

merged 1 commit into from
Feb 13, 2016

Conversation

cruegge
Copy link
Contributor

@cruegge cruegge commented Feb 11, 2016

Added a basic test for #1148. Turned out simpler than I thought ;)

@gracjan
Copy link
Contributor

gracjan commented Feb 11, 2016

Nice! Can I have a wish or two:

  1. Use :expected-result :failed like in other failing test cases.
  2. Add two more, successful cases.

When you are done force-push it to the same branch, github will pick up the change.

Thanks.

@cruegge
Copy link
Contributor Author

cruegge commented Feb 12, 2016

While thinking of useful successful test cases, I stumbled upon another weird behaviour, which occurs when calling haskell-forward-sexp with a prefix arg larger than 1.

  • When point is at an opening paren, the function delegates to scan-sexp, which does not know about Haskell tokens. So C-u 4 C-M-f may lead to different results than 4 times C-M-f.
  • When point is not on an opening paren, arg is ignored completely.

I wrote an additional successful test case for the original problem, and for each of the new ones a failing and a successful one (I'm going to push them in a moment). I also have a possible fix for all cases; if you like, I can open a new PR, or push it here as well.

@gracjan
Copy link
Contributor

gracjan commented Feb 12, 2016

You can add the fix here.

gracjan added a commit that referenced this pull request Feb 13, 2016
Add test and fixes for forward-sexp-function
@gracjan gracjan merged commit 3d3dac7 into haskell:master Feb 13, 2016
@gracjan
Copy link
Contributor

gracjan commented Feb 13, 2016

@cruegge, we need the backward case implemented, too. It is tracked in #759 where there is also a description of an idea how to get it done. Can you get a go at it?

@cruegge
Copy link
Contributor Author

cruegge commented Feb 14, 2016

I see what I can do.

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

Successfully merging this pull request may close these issues.

2 participants