Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Test RegEx not catching all cases #63

Closed
1 task done
duckontheweb opened this issue Nov 11, 2017 · 2 comments
Closed
1 task done

Test RegEx not catching all cases #63

duckontheweb opened this issue Nov 11, 2017 · 2 comments

Comments

@duckontheweb
Copy link
Contributor

Please describe your issue clearly and also include all details below.

Details

  • avn 0.2.3
  • node v6.11.5
  • nvm 0.33.6
  • n 2.0.0
  • zsh zsh 5.0.8 (x86_64-apple-darwin15.0)
  • bash version 3.2.57(1)-release (x86_64-apple-darwin15)

The output of __avn_debug in the directory with a .node-version file is:

# paste output here

avn is loaded in my ~/.{bash|zsh}{_profile|rc} file with:

# find the relevant line(s) in your profile & note path above

nvm specific

  • As an nvm user I am confirming that I did not install with Homebrew

I am starting in on a PR for #43, but I have a couple of tests failing. One of them is the fails for any failed action test in test/setup.js, which give the following failed test output:

AssertionError: expected 'error: EACCES: permission denied, open \'/var/folders/1p/9z6dp_4n2cd27d2ktj6w_xv40000gn/T/d-1171011-15092-10e8ilz.4tsh8h0k9/.bash_profile\'\n' to match /^error: EACCES.*, open '[\/\w-]*\/.bash_profile'\n$/

It looks like the regex is just not catching my error message case. I can dig into the regex and fix it to catch this, but I wanted to bring this to your attention in case it's a known issue that I should ignore.

@duckontheweb
Copy link
Contributor Author

duckontheweb commented Nov 11, 2017

This is the old regex:

/^error: EACCES.*, open '[\/\w-]*\/.bash_profile'\n$/

This is the updated regex that catches my case:

/^error: EACCES.*, open '[\/\w-\d\.]*\/.bash_profile'\n$/

The changes were matching digits and the dot character in the directory portion before .bash_profile. I've tested this locally and the test now passes.

@wbyoung
Copy link
Owner

wbyoung commented Nov 12, 2017

@duckontheweb looks like a good change. Please feel free to throw up a separate PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants