aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2022-10-24 14:32:13 +0200
committerDaniel Gavin <danielgavin5@hotmail.com>2022-10-24 14:32:13 +0200
commited1a43af18f4cce0cbe18b59e3265a9b495a381f (patch)
tree8a219b4bc3efe0283270704959af6bdc5dcc5670
parentc23e9c0aea54f116cb3ea9095f06575a6b8f6d3d (diff)
adding new tests for odinfmt
-rw-r--r--tools/odinfmt/tests/.snapshots/if.odin25
-rw-r--r--tools/odinfmt/tests/if.odin19
2 files changed, 44 insertions, 0 deletions
diff --git a/tools/odinfmt/tests/.snapshots/if.odin b/tools/odinfmt/tests/.snapshots/if.odin
new file mode 100644
index 0000000..e1c05d1
--- /dev/null
+++ b/tools/odinfmt/tests/.snapshots/if.odin
@@ -0,0 +1,25 @@
+package odinfmt_test
+
+
+if_one :: proc() {
+ if i := strings.index(imp.fullpath, ":");
+ i != -1 && i > 1 && i < len(imp.fullpath) - 1 {
+ }
+}
+
+if_two :: proc() {
+ if ret := unmarshal(
+ j[field[:len(field) - 1]],
+ a,
+ allocadsdsdsdsdsdsdsdtor,
+ ); ret != nil {
+ }
+}
+
+if_three :: proc() {
+ if position_in_node(
+ position_context.binary.raaaaaaaaaaaaaaaaaaaight,
+ position_context.position,
+ ) {
+ }
+}
diff --git a/tools/odinfmt/tests/if.odin b/tools/odinfmt/tests/if.odin
new file mode 100644
index 0000000..26ada3d
--- /dev/null
+++ b/tools/odinfmt/tests/if.odin
@@ -0,0 +1,19 @@
+package odinfmt_test
+
+
+if_one :: proc() {
+ if i := strings.index(imp.fullpath, ":"); i != -1 && i > 1 && i < len(imp.fullpath) - 1 {
+ }
+}
+
+if_two :: proc() {
+ if ret := unmarshal(j[field[:len(field) - 1]], a, allocadsdsdsdsdsdsdsdtor); ret != nil {
+ }
+}
+
+if_three :: proc() {
+ if position_in_node(
+ position_context.binary.raaaaaaaaaaaaaaaaaaaight,
+ position_context.position) {
+ }
+} \ No newline at end of file