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

Use slash instead of backslash under Windows #29

Open
andreasabel opened this issue Nov 20, 2022 · 1 comment · May be fixed by #30
Open

Use slash instead of backslash under Windows #29

andreasabel opened this issue Nov 20, 2022 · 1 comment · May be fixed by #30
Assignees
Milestone

Comments

@andreasabel
Copy link
Collaborator

I get not ok ... stdout verdicts under Windows when the same tests pass under Linux and macOS.
I'd guess these are caused by directory globbing resolved under Windows using backslashes instead of slashes, so printing the filepath to stdout gives different results under Linux and Windows. https://github.com/andreasabel/miniagda/blob/67f9ad914f8bbda153d679a517da98b01e482d4e/test/fail/adm/adm1.err#L1
Since Windows nowadays understands the slash as path separator, maybe the slash could be used instead of the backslash to make goldplate more portable?

@andreasabel
Copy link
Collaborator Author

It could be that the call to normalise here is to blame: https://github.com/fugue/goldplate/blob/5ca490ca7845417f7f67da5fb682001468e2862f/src/Main.hs#L222
According to the docs, it includes the following replacement:

/ -> pathSeparator

This means that under Windows, slashes become backslashes.

andreasabel added a commit that referenced this issue Nov 21, 2022
`System.FilePath.normalise` replaces slashes by backslashes.
We implement a simplified version of `normalise` that does the opposite.

This should make (relative) file path printed in test output more portable across OSs.
@andreasabel andreasabel linked a pull request Nov 21, 2022 that will close this issue
andreasabel added a commit that referenced this issue Feb 11, 2023
`System.FilePath.normalise` replaces slashes by backslashes.
We implement a simplified version of `normalise` that does the opposite.

This should make (relative) file path printed in test output more portable across OSs.
@andreasabel andreasabel added this to the 0.3.0 milestone Feb 11, 2023
@andreasabel andreasabel self-assigned this Feb 11, 2023
andreasabel added a commit that referenced this issue Feb 12, 2023
`System.FilePath.normalise` replaces slashes by backslashes.
We implement a simplified version of `normalise` that does the opposite.

This should make (relative) file path printed in test output more portable across OSs.
andreasabel added a commit that referenced this issue Feb 26, 2023
`System.FilePath.normalise` replaces slashes by backslashes.
We implement a simplified version of `normalise` that does the opposite.

This should make (relative) file path printed in test output more portable across OSs.
andreasabel added a commit that referenced this issue Aug 3, 2023
`System.FilePath.normalise` replaces slashes by backslashes.
We implement a simplified version of `normalise` that does the opposite.

This should make (relative) file path printed in test output more portable across OSs.
andreasabel added a commit that referenced this issue Jul 1, 2024
`System.FilePath.normalise` replaces slashes by backslashes.
We implement a simplified version of `normalise` that does the opposite.

This should make (relative) file path printed in test output more portable across OSs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant