aboutsummaryrefslogtreecommitdiff
path: root/tests/actions_test.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2026-02-12 15:11:10 +1100
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2026-02-12 15:11:14 +1100
commitee32288b28a939bd500143589800217f844031cb (patch)
tree8887736ced99ba5c39f75b22448f966e2a6e74cf /tests/actions_test.odin
parent4f309f96acc53f788dabf7a9d0cb7319dbe16ebd (diff)
Resolve decls in when statements to fix incorrectly flagging imports as unused
Diffstat (limited to 'tests/actions_test.odin')
-rw-r--r--tests/actions_test.odin23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/actions_test.odin b/tests/actions_test.odin
new file mode 100644
index 0000000..935e168
--- /dev/null
+++ b/tests/actions_test.odin
@@ -0,0 +1,23 @@
+package tests
+
+import "core:testing"
+
+import test "src:testing"
+
+@(test)
+action_remove_unsed_import_when_stmt :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ import "core:fm{*}t"
+
+ when true {
+ main :: proc() {
+ _ = fmt.printf
+ }
+ }
+ `,
+ packages = {},
+ }
+
+ test.expect_action(t, &source, {})
+}