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

"other whitespace" in bob_test fails example.sh #27

Closed
qjd2413 opened this issue Sep 18, 2016 · 5 comments
Closed

"other whitespace" in bob_test fails example.sh #27

qjd2413 opened this issue Sep 18, 2016 · 5 comments

Comments

@qjd2413
Copy link

qjd2413 commented Sep 18, 2016

All other tests pass. bob.sh is executable.
Using bash 4.3.46 and Bats 0.4.0

@kenden
Copy link
Contributor

kenden commented Sep 19, 2016

@qjd2413 Thanks for reporting the issue!

"It works on my machine" (TM)(C) with the same versions...

Could you send the results of those commands?

$ uname -a
$ which bash

Also, could you add set -o xtrace (debug mode) after the first line in
exercises/bob/bob.sh, run:

$ cd exercises/bob && bash bob.sh "\n\r \t\u000b\u00a0\u2002"

And send the result?

@qjd2413
Copy link
Author

qjd2413 commented Sep 19, 2016

$> uname -a
Linux machine-name 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016
x86_64 x86_64 x86_64 GNU/Linux
$> which bash
/bin/bash
$> bash bob.sh "\n\r \t\u000b\u00a0\u2002"
++ printf %b '\n\r \t\u000b\u00a0\u2002'
+ input='

          '
+ input= 
+ [[   == '' ]]
+ [[   == *[[:upper:]]* ]]
+ [[   == \? ]]
+ echo Whatever.
Whatever.

@kenden
Copy link
Contributor

kenden commented Sep 19, 2016

Strange, "\u00a0" is matched by [[:space:]] on mac but not Linux. I could repro and fix on Ubuntu.

@platinumthinker
Copy link
Contributor

Usage this for utf support:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8

@kenden
Copy link
Contributor

kenden commented Sep 2, 2017

Fixed

@kenden kenden closed this as completed Sep 2, 2017
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

No branches or pull requests

3 participants