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

Test suite: Do checks on UnicodeSyntax, too. #716

Merged
merged 2 commits into from Jun 11, 2015

Conversation

eigengrau
Copy link
Contributor

This automatically transforms check input to UnicodeSyntax and
runs the test twice; once on the original, once on the Unicode
version.

Note that I don’t really know what I’m doing with my Elisp. Is this
usable to you? In my test it catches #715.

Since this is using a dumb search&replace, instead of requiring
separate tests for Unicode cases, e. g. things like -> can’t be used
in Haskell strings inside of the test cases, which is probably not an
issue.

@eigengrau
Copy link
Contributor Author

Almost, but not quite. What you want is to match consecutive characters that compose a symbol and then only change a symbol that is in the list, so for example <<- should not be partially changed into < plus Unicode for <-.

Right, good catch. This would affect -< and -<<. Might be worked around by iterating over longer replacements first.

This idea looks a bit too smart for my taste. It is worth to be more explicit in tests about what is and what is not tested as in case of failure error messages are incomprehensible.

Fair enough. I don’t know anything about ERT, but I wonder if one could do this automatically and still have nominally separate units for Unicode and ASCII (generating units on the fly before a test run?). A mixture case could be added manually. If the parsing haskell-indentation does is uniform, one could just have a single test case for indentation with UnicodeSyntax; but looking over the file, there appeared to be a lot of individual literal references to things like <-, which is why I thought one might want to test the unicode equivalent of every regular test case.

@gracjan
Copy link
Contributor

gracjan commented Jun 11, 2015 via email

@eigengrau eigengrau force-pushed the unicode-indentation-checks branch 2 times, most recently from 564de05 to 93618fa Compare June 11, 2015 14:21
@eigengrau
Copy link
Contributor Author

Ah, you added a new one. Rebased!

@eigengrau
Copy link
Contributor Author

Please mark those tests that fail as: :expected_result :failed

Just for the ones that should fail, though, right? Or does this have something to do with CI?

@gracjan
Copy link
Contributor

gracjan commented Jun 11, 2015 via email

gracjan added a commit that referenced this pull request Jun 11, 2015
Test suite: Do checks on UnicodeSyntax, too.
@gracjan gracjan merged commit 3740612 into haskell:master Jun 11, 2015
@gracjan
Copy link
Contributor

gracjan commented Jun 11, 2015

Great! Thanks!

Now we need to actually fix it :)

@eigengrau
Copy link
Contributor Author

:)

@eigengrau eigengrau deleted the unicode-indentation-checks branch June 11, 2015 14:48
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.

None yet

2 participants