commit d3c29be9ad1ec615021bd61d3504aaa206f894da
parent 18dbd57e9ff789bd4b1d64b27659bd97e4477dce
Author: Lou Woell <lou.woell@posteo.de>
Date:   Tue, 17 Feb 2026 03:50:39 +0100

[locate] add test for enum locations

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

diff --git a/cmd/harehelper/+test/locate_test.ha b/cmd/harehelper/+test/locate_test.ha @@ -212,3 +212,40 @@ fn loc_test_fn (in: str, out: lex::location) void = { ... }); }; + +@test fn locate_enum() void = { + loc_test_fn("hare::ast::builtin_type", lex::location { + path = "type.ha", + line = 10, + col = 1, + ... + }); +}; + +@test fn locate_enum_member() void = { + loc_test_fn("hare::ast::builtin_type", lex::location { + path = "type.ha", + line = 10, + col = 1, + ... + }); +}; + +@test fn locate_enum_member_nonexisting() void = { + loc_test_fn("hare::ast::builtin_type::lou", lex::location { + path = "type.ha", + line = 10, + col = 1, + ... + }); +}; + +@test fn locate_enum_nonexisting() void = { + test::expectabort(); + loc_test_fn("hare::ast::lou::lou", lex::location { + path = "type.ha", + line = 10, + col = 1, + ... + }); +};