diff options
| author | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-18 09:06:59 -0400 |
|---|---|---|
| committer | Brad Lewis <22850972+BradLewis@users.noreply.github.com> | 2025-08-18 09:06:59 -0400 |
| commit | cff8506a90984086d4a3455396d38f996b17ab73 (patch) | |
| tree | 11635347bbfa441307664389acb8e7176a48fa26 /tools | |
| parent | 6d12396da33352a47aa821b48e51512c3601b124 (diff) | |
Fix issue with odinfmt stripping the semicolon after a switch init with no condition
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/odinfmt/tests/.snapshots/switch.odin | 17 | ||||
| -rw-r--r-- | tools/odinfmt/tests/switch.odin | 19 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tools/odinfmt/tests/.snapshots/switch.odin b/tools/odinfmt/tests/.snapshots/switch.odin new file mode 100644 index 0000000..f4bd9ac --- /dev/null +++ b/tools/odinfmt/tests/.snapshots/switch.odin @@ -0,0 +1,17 @@ +package odinfmt_test + +main :: proc() { + foos := []string{"foo", "bar"} + + for i in 0 ..< len(foos) { + switch foo := foo[i]; { + case "foo": + } + } + + for i in 0 ..< len(foos) { + switch foo := foo[i]; foo { + case "foo": + } + } +} diff --git a/tools/odinfmt/tests/switch.odin b/tools/odinfmt/tests/switch.odin new file mode 100644 index 0000000..f17d010 --- /dev/null +++ b/tools/odinfmt/tests/switch.odin @@ -0,0 +1,19 @@ +package odinfmt_test + +main :: proc() { + foos := []string{ + "foo", "bar"} + + for i in 0..<len(foos) { + switch foo := foo[i]; { + case "foo": + } + } + + for i in 0..<len(foos) { + switch foo := foo[i]; + foo { + case "foo": + } + } +} |