# \`add Test\` fails in presence of \`test\` directory on macOS

**URL:** <https://discourse.julialang.org/t/add-test-fails-in-presence-of-test-directory-on-macos/35118>\
**Category:** General Usage\
**Created:** [February 25, 2020, 3:13pm UTC](https://discourse.julialang.org/t/add-test-fails-in-presence-of-test-directory-on-macos/35118 "2020-02-25T15:13:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlhetland](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mlhetland/32/283_2.png) [@mlhetland](https://discourse.julialang.org/u/mlhetland)\
**Post date:** [February 25, 2020, 3:13pm UTC](https://discourse.julialang.org/t/add-test-fails-in-presence-of-test-directory-on-macos/35118/1 "2020-02-25T15:13:56Z")

</div>

The macOS file system is case insenitive but case preserving, so if you have a directory named `test` in your project (which is standard) and you try to add the `Test` module (which you need to do testing), you get the following error (1.4.0-rc1.0):

```nohighlight
[ Info: Resolving package identifier `Test` as a directory at `/path/to/Project/Test`.
ERROR: Did not find a git repository at `Test`

```

That’s because the `test` directory is interpreted as a directory named `Test`, which then collides with the module name, and Julia blithely starts looking for the module there.

The workaround is to add the `Test` module before you create the `test` directory, which is not a problem – but perhaps one might wish to address this, somehow? E.g. somehow handle case issues on macOS or at least have a tailored error message specifically for `Test` where this collision is bound to occur for every project with a standard test setup on macOS, unless you do things in the right order?

And creating the directory first isn’t that unnatural. After all, if you try to run `test` in the package manager, you’re told the directory (with `runtests.jl`) is missing; then you add the directory and file, add `using Test`, and then you’re told you don’t have the module in your dependencies. Then you try to add it, and it fails…

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [February 25, 2020, 3:31pm UTC](https://discourse.julialang.org/t/add-test-fails-in-presence-of-test-directory-on-macos/35118/2 "2020-02-25T15:31:49Z")

</div>

Will be fixed by [change REPL path resolution by 00vareladavid · Pull Request #1636 · JuliaLang/Pkg.jl · GitHub](https://github.com/JuliaLang/Pkg.jl/pull/1636).
