# Errors when testing unregistered custom package (because of non-ASCII characters, it seems)

**URL:** https://discourse.julialang.org/t/errors-when-testing-unregistered-custom-package-because-of-non-ascii-characters-it-seems/40554
**Category:** Package Management
**Tags:** testing, strings, pkg
**Created:** [June 1, 2020, 11:04am UTC](https://discourse.julialang.org/t/errors-when-testing-unregistered-custom-package-because-of-non-ascii-characters-it-seems/40554 "2020-06-01T11:04:04Z")
**Posts on this page:** 5
**Page:** 2

<div class="post-metadata">

### Author: ![D\_A](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@D\_A](https://discourse.julialang.org/u/D_A)
#### Post date: [June 1, 2020, 12:40pm UTC](https://discourse.julialang.org/t/errors-when-testing-unregistered-custom-package-because-of-non-ascii-characters-it-seems/40554/23 "2020-06-01T12:40:32Z")

</div>

```julia
benjamin@benjamin-pc:~/Projets/test$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.4.2 (2020-05-23)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(@v1.4) pkg> generate GoodPackage
 Generating project GoodPackage:
    GoodPackage/Project.toml
    GoodPackage/src/GoodPackage.jl

(@v1.4) pkg> generate BadPackæge
 Generating project BadPackæge:
    BadPackæge/Project.toml
    BadPackæge/src/BadPackæge.jl

(@v1.4) pkg> activate GoodPackage
 Activating environment at `~/Projets/test/GoodPackage/Project.toml`

julia> cd("GoodPackage/")

(GoodPackage) pkg> activate ./test
 Activating new environment at `~/Projets/test/GoodPackage/test/Project.toml`

(test) pkg> add Test
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Resolving package versions...
   Updating `~/Projets/test/GoodPackage/test/Project.toml`
  [8dfed614] + Test 
   Updating `~/Projets/test/GoodPackage/test/Manifest.toml`
  [2a0f44e3] + Base64 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [8dfed614] + Test 

julia> println(read("test/runtests.jl", String))
using Test
using GoodPackage

GoodPackage.greet()

@test true

(test) pkg> activate .
 Activating environment at `~/Projets/test/GoodPackage/Project.toml`

(GoodPackage) pkg> test
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Updating `~/Projets/test/GoodPackage/Project.toml`
 [no changes]
   Updating `~/Projets/test/GoodPackage/Manifest.toml`
 [no changes]
    Testing GoodPackage
Status `/tmp/jl_yTuxRY/Manifest.toml`
  [d2c24135] GoodPackage v0.1.0 [`~/Projets/test/GoodPackage`]
  [2a0f44e3] Base64 
  [8ba89e20] Distributed 
  [b77e0a4c] InteractiveUtils 
  [56ddb016] Logging 
  [d6f4376e] Markdown 
  [9a3f8284] Random 
  [9e88b42a] Serialization 
  [6462fe0b] Sockets 
  [8dfed614] Test 
Hello World! Testing GoodPackage tests passed 

julia> cd("..")

(GoodPackage) pkg> activate BadPackæge
 Activating environment at `~/Projets/test/BadPackæge/Project.toml`

julia> cd("BadPackæge/")

(BadPackæge) pkg> activate ./test
 Activating new environment at `~/Projets/test/BadPackæge/test/Project.toml`

(test) pkg> add Test
  Resolving package versions...
   Updating `~/Projets/test/BadPackæge/test/Project.toml`
  [8dfed614] + Test 
   Updating `~/Projets/test/BadPackæge/test/Manifest.toml`
  [2a0f44e3] + Base64 
  [8ba89e20] + Distributed 
  [b77e0a4c] + InteractiveUtils 
  [56ddb016] + Logging 
  [d6f4376e] + Markdown 
  [9a3f8284] + Random 
  [9e88b42a] + Serialization 
  [6462fe0b] + Sockets 
  [8dfed614] + Test 

julia> println(read("test/runtests.jl", String))
using Test
using BadPackæge

BadPackæge.greet()

@test true

(test) pkg> activate .
 Activating environment at `~/Projets/test/BadPackæge/Project.toml`

(BadPackæge) pkg> test
   Updating registry at `~/.julia/registries/General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Updating `~/Projets/test/BadPackæge/Project.toml`
 [no changes]
   Updating `~/Projets/test/BadPackæge/Manifest.toml`
 [no changes]
    Testing BadPackæge
Status `/tmp/jl_eVXLCZ/Manifest.toml`
  [de51fa18] BadPackæge v0.1.0 [`~/Projets/test/BadPackæge`]
  [2a0f44e3] Base64 
  [8ba89e20] Distributed 
  [b77e0a4c] InteractiveUtils 
  [56ddb016] Logging 
  [d6f4376e] Markdown 
  [9a3f8284] Random 
  [9e88b42a] Serialization 
  [6462fe0b] Sockets 
  [8dfed614] Test 
ERROR: LoadError: ArgumentError: Package BadPackæge not found in current path:
- Run `import Pkg; Pkg.add("BadPackæge")` to install the BadPackæge package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:892
 [2] include(::String) at ./client.jl:439
 [3] top-level scope at none:6
in expression starting at /home/benjamin/Projets/test/BadPackæge/test/runtests.jl:2
ERROR: Package BadPackæge errored during testing

(BadPackæge) pkg> 

```

So, because of the _æ_ character in package name (mine starts by _Œ_, but I renamed it to make it easier, which was not the best idea here), seemingly unrelated error is thrown.

Thank you. It was a good advice to try to restart a test project to compare little by little.

I created an issue on Julia Github for that.

---

<div class="post-metadata">

### Author: ![ppalmes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ppalmes/32/6838_2.png) [@ppalmes](https://discourse.julialang.org/u/ppalmes)
#### Post date: [June 1, 2020, 1:24pm UTC](https://discourse.julialang.org/t/errors-when-testing-unregistered-custom-package-because-of-non-ascii-characters-it-seems/40554/24 "2020-06-01T13:24:56Z")

</div>

still, you are not supposed to activate the toml in test/ directory. just look at all the registered packages. they don’t use that project.toml in the test directory. you are supposed to activate the package itself.

follow this: [5. Creating Packages · Pkg.jl](https://julialang.github.io/Pkg.jl/v1/creating-packages/index.html)

---

<div class="post-metadata">

### Author: ![D\_A](https://avatars.discourse-cdn.com/v4/letter/d/8dc957/32.png) [@D\_A](https://discourse.julialang.org/u/D_A)
#### Post date: [June 1, 2020, 1:46pm UTC](https://discourse.julialang.org/t/errors-when-testing-unregistered-custom-package-because-of-non-ascii-characters-it-seems/40554/25 "2020-06-01T13:46:16Z")

</div>

Are you really sure? On the link you gave me, and that I linked several times because I followed it, there is this paragraph:

> To add a test-specific dependency, i.e. a dependency that is available only when testing, it is thus enough to add this dependency to the `test/Project.toml` project. This can be done from the Pkg REPL by activating this environment, and then use `add` as one normally does. Lets add the `Test` standard library as a test dependency:
> 
> ```julia
> (HelloWorld) pkg> activate ./test
> [ Info: activating environment at `~/HelloWorld/test/Project.toml`.
> 
> (test) pkg> add Test
> Resolving package versions...
> Updating `~/HelloWorld/test/Project.toml`
> [8dfed614] + Test
> Updating `~/HelloWorld/test/Manifest.toml`
> [...]
> 
> ```

And to be sure we understand each other enough: I never activate MyPackage/test for test, but just to add some test-specific dependencies, so it is made once during the prototyping (in order to add Test package itself, because I don’t need it in MyPackage, just in MyPackage/test), as you can see on all of my messages.

---

<div class="post-metadata">

### Author: ![ppalmes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ppalmes/32/6838_2.png) [@ppalmes](https://discourse.julialang.org/u/ppalmes)
#### Post date: [June 1, 2020, 3:01pm UTC](https://discourse.julialang.org/t/errors-when-testing-unregistered-custom-package-because-of-non-ascii-characters-it-seems/40554/26 "2020-06-01T15:01:23Z")

</div>

In Julia 1.0 and Julia 1.1 test-specific dependencies are added to the main `Project.toml` . To add `Markdown` and `Test` as test-dependencies, add the following:

```julia
[extras]
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Markdown", "Test"]

```

---

<div class="post-metadata">

### Author: ![ppalmes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ppalmes/32/6838_2.png) [@ppalmes](https://discourse.julialang.org/u/ppalmes)
#### Post date: [June 1, 2020, 3:03pm UTC](https://discourse.julialang.org/t/errors-when-testing-unregistered-custom-package-because-of-non-ascii-characters-it-seems/40554/28 "2020-06-01T15:03:17Z")

</div>

ok, seems recently they allow now or encourage Project.toml in test/

[Previous page](https://discourse.julialang.org/t/errors-when-testing-unregistered-custom-package-because-of-non-ascii-characters-it-seems/40554.md?page=1)
