aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-07 14:00:46 -0400
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-07 14:00:46 -0400
commit0a254711a65bea797dc64946d64b9c614460a93a (patch)
tree1ef121d987a009f9568af9048febd41f2422fc89 /src/testing
parent4a78b4ad1dca9a1218c4df2d97bfb5d9465bc063 (diff)
Fix issue with structs and enum variants with the same names colliding with references
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing.odin15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/testing/testing.odin b/src/testing/testing.odin
index 7242b39..d80b727 100644
--- a/src/testing/testing.odin
+++ b/src/testing/testing.odin
@@ -342,7 +342,12 @@ expect_type_definition_locations :: proc(t: ^testing.T, src: ^Source, expect_loc
}
}
-expect_reference_locations :: proc(t: ^testing.T, src: ^Source, expect_locations: []common.Location) {
+expect_reference_locations :: proc(
+ t: ^testing.T,
+ src: ^Source,
+ expect_locations: []common.Location,
+ expect_excluded: []common.Location = nil,
+) {
setup(src)
defer teardown(src)
@@ -367,6 +372,14 @@ expect_reference_locations :: proc(t: ^testing.T, src: ^Source, expect_locations
log.errorf("%v \n", location)
}
}
+
+ for expect_exclude in expect_excluded {
+ for location in locations {
+ if expect_exclude.range == location.range {
+ log.errorf("Expected location %v to not be included\n", expect_exclude)
+ }
+ }
+ }
}
expect_prepare_rename_range :: proc(t: ^testing.T, src: ^Source, expect_range: common.Range) {