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

Gherkin C tests fail on Wine #168

Closed
aslakhellesoy opened this issue Mar 22, 2017 · 1 comment · Fixed by #193
Closed

Gherkin C tests fail on Wine #168

aslakhellesoy opened this issue Mar 22, 2017 · 1 comment · Fixed by #193

Comments

@aslakhellesoy
Copy link
Contributor

Summary

Approval tests (diffing golden masters) fail with gherkin.exe running on Wine

Expected Behavior

I'd expect it to work just as on other Linuxes and OS X.

Current Behavior

Tokens with non-ASCII (Unicode) characters are printed as ?, causing the diff to fail:

wine bin/gherkin_generate_tokens.exe testdata/good/escaped_pipes.feature > acceptance/testdata/good/escaped_pipes.feature.tokens
diff --strip-trailing-cr --unified testdata/good/escaped_pipes.feature.tokens acceptance/testdata/good/escaped_pipes.feature.tokens
--- testdata/good/escaped_pipes.feature.tokens	2017-03-21 20:38:38.000000000 +0000
+++ acceptance/testdata/good/escaped_pipes.feature.tokens	2017-03-22 12:51:02.000000000 +0000
@@ -4,11 +4,11 @@
 (4:1)Other://
 (5:3)ScenarioLine:Scenario/They are the future/
 (6:5)StepLine:Given /they have arrived/
-(7:7)TableRow://9:æ,13:o
-(8:7)TableRow://9:a,13:ø
+(7:7)TableRow://9:?,13:o
+(8:7)TableRow://9:a,13:?
 (9:5)StepLine:Given /they have arrived/
-(10:7)TableRow://9:|æ\n,22:\o
+(10:7)TableRow://9:|?\n,22:\o
 o\
-(11:7)TableRow://9:\|a\\n,22:ø\
-ø\
+(11:7)TableRow://9:\|a\\n,22:?\
+?\
 EOF
make: *** [acceptance/testdata/good/escaped_pipes.feature.tokens] Error 1
make: *** Deleting file `acceptance/testdata/good/escaped_pipes.feature.tokens'

This can also be seen on Travis.

Possible Solution

Not sure

Steps to Reproduce (for bugs)

First, install mingw-w64 as described in CONTRIBUTING.md

git clean -dfx gherkin/c
make CC=i686-w64-mingw32-gcc

Context & Motivation

The main reason I want this to pass is to use Travis to build distributable binaries for end users.

I'm not certain there is a problem with the gherkin.exe being built, as I haven't tried to run it on a Windows machine. It could be that this is a bug in Wine. It could also be a bug in the compiler or libraries used by mingw-w64. We'd have to test this manually on Windows to find out I suppose.

Your Environment

  • Version used: HEAD of master
  • Operating System and version: OS X 10.11.6 (15G31) with wine-2.0 (installed with homebrew)
aslakhellesoy referenced this issue Apr 23, 2017
On Windows wchar_t is 2 bytes large, and use UTF-16. This means that
for the case of code points > 0xFFFF (and wchar_t is only 2 bytes
large), the code point read from the UTF-8 source need to be converted
to two UTF-16 surrogates (wchar_t wide characters).
aslakhellesoy added a commit that referenced this issue May 1, 2017
@lock
Copy link

lock bot commented Oct 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants