-
Notifications
You must be signed in to change notification settings - Fork 440
Closed
Labels
Component: Bash CodeEverything regarding the bash codeEverything regarding the bash codePriority: HighBroken behavior in specific environments like in parallel mode or only on some operating systemsBroken behavior in specific environments like in parallel mode or only on some operating systemsStatus: WontfixType: Bug
Milestone
Description
Default line endings on different platforms are not stripped - making it hard to interact with native applications on Cygwin.
Consider the following test suite
@test 'Cygwin Python' {
run python3.8 -m this
[[ ${lines[0]} == 'The Zen of Python, by Tim Peters' ]]
}
@test 'Windows Python' {
run python -m this
[[ ${lines[0]} == 'The Zen of Python, by Tim Peters' ]]
}
Result:
✓ Cygwin Python
✗ Windows Python
(in test file test.bats, line 8)
`[[ ${lines[0]} == 'The Zen of Python, by Tim Peters' ]]' failed
2 tests, 1 failure
By the way: unless you already know what the issue is, bats
gives you no aide for debugging. I suspected \r\n
line endings from Windows Python. Let's sanitize explicitly
@test 'Windows Python' {
run python -m this
[[ ${lines[0]%[[:cntrl:]]} == 'The Zen of Python, by Tim Peters' ]]
}
...works...
✓ Cygwin Python
✓ Windows Python
2 tests, 0 failures
Metadata
Metadata
Assignees
Labels
Component: Bash CodeEverything regarding the bash codeEverything regarding the bash codePriority: HighBroken behavior in specific environments like in parallel mode or only on some operating systemsBroken behavior in specific environments like in parallel mode or only on some operating systemsStatus: WontfixType: Bug