odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.78k stars 592 forks source link

Directories with dots in their name produce empty paths #2807

Open Nezteb opened 1 year ago

Nezteb commented 1 year ago

Context

Expected Behavior

Directories containg dots (~/src/.meta) should be treated no differently than directories without dots (~/src/meta).

Current Behavior

Directories containing dots aren't properly read by Odin subcommands.

Failure Information (for bugs)

Subcommands like odin test will fail to run tests in a directory with a dot in its name because of this bug.

The error message also contains two consecutive spaces where there should be an actual path string.

Steps to Reproduce

> odin test exercises/practice/hello-world/meta

[Package: hello_world]
[Test: test]
/home/runner/odin/exercises/practice/hello-world/meta/hello_world_test.odin(9:2): expected Hello, World!, got Goodbye, Mars!
[test : FAILURE]
----------------------------------------
0/1 SUCCESSFUL

> mv exercises/practice/hello-world/meta exercises/practice/hello-world/.meta

> odin test exercises/practice/hello-world/.meta/

Output path  is a directory.
gingerBill commented 1 year ago

This bug is quite an obvious one. The executable name is trying to be based on the directory name, but because it is called .meta, it looks like you have assigned an extension to it already and it is trying to assign it to that.

matthewelmer commented 2 months ago

Can I help fix this? How would I go about doing so?