commit f6ef1673462a2f481c0c37ff3512dd961a0dfe78
parent be17e022d8d17fcbb9f2034e1c14a2f1392dde2b
Author: Lou Woell <lou.woell@posteo.de>
Date:   Fri, 10 Oct 2025 04:30:59 +0200

[locate] New test cases

Diffstat:
Mcmd/harehelper/+test/locate_test.ha | 29+++++++++++++++++++++++++++++
1 file changed, 29 insertions(+), 0 deletions(-)

diff --git a/cmd/harehelper/+test/locate_test.ha b/cmd/harehelper/+test/locate_test.ha @@ -112,6 +112,16 @@ fn loc_test_fn (in: str, out: lex::location) void = { }); }; +@test fn locate_module_cwd () void = { + os::chdir("./cmd/harehelper/")!; + loc_test_fn("os", lex::location { + path = "os", + line = 0, + col = 0, + ... + }); +}; + @test fn locate_module_trailing () void = { loc_test_fn("os::", lex::location { path = "os", @@ -141,6 +151,25 @@ fn loc_test_fn (in: str, out: lex::location) void = { }); }; +@test fn locate_submodule () void = { + loc_test_fn("hare::parse", lex::location { + path = "parse", + line = 0, + col = 0, + ... + }); +}; + +@test fn locate_submodule_cwd () void = { + os::chdir("./cmd/harehelper/")!; + loc_test_fn("hare::parse", lex::location { + path = "parse", + line = 0, + col = 0, + ... + }); +}; + @test fn locate_local_from_base() void = { os::chdir("./cmd/harehelper")!; loc_test_fn("locate", lex::location {