• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbland / go-script-bash / 283
95%

Build:
DEFAULT BRANCH: master
Ran 17 Dec 2016 06:30PM UTC
Jobs 1
Files 38
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
283

push

travis-ci

mbland
log: Extract helper script to fix Windows breakage

PR #28 introduced the `stack_trace_item` test helper function so that tests
could validate expected stack trace output without hardcoding line numbers. I
failed to notice that this behavior was broken on Windows, due to leading
whitespace getting stripped and CRLF line endings not being handled by the
`while read -r line` loop.

The fix for the whitespace was easy. Per the following, setting `IFS=` did the
trick:

https://stackoverflow.com/questions/29689172/bash-read-line-does-not-read-leading-spaces/29689199#2968919

However, adding the following as the first line of the loop by itself wasn't
enough:

    line="${line%$'\r'}"

It turned out that when the `stack-trace-item` file was getting written, it
would replace this line with:

    line="${line%^M}";

where `^M` was the literal carriage return character, not the Bash string.
Somehow this was causing the line to continue to retain its trailing carriage
return, causing the tests to continue to fail.

I only started to figure this out after adding some `echo` statements to print
things to standard error, followed by one of:

    | sed -n l >&2
    | od -A n -vt c >&2

per:

https://unix.stackexchange.com/questions/213504/how-to-print-control-characters-with-escape-sequences/213510#213510

Eventually I realized it made sense to break out the script anyway, as it
wasn't being customized by the `stack_trace_item` function. Now the tests all
pass on Windows.

1645 of 1738 relevant lines covered (94.65%)

123.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 283.1 17 Dec 2016 06:30PM UTC 0
94.65
Travis Job 283.1
Source Files on build 283
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #283
  • 3ea08f38 on github
  • Prev Build on master (#270)
  • Next Build on master (#285)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc