about summary refs log tree commit diff stats
path: root/awk/rawk/scratch/debug_findindex_simple.rawk
diff options
context:
space:
mode:
Diffstat (limited to 'awk/rawk/scratch/debug_findindex_simple.rawk')
-rw-r--r--awk/rawk/scratch/debug_findindex_simple.rawk34
1 files changed, 34 insertions, 0 deletions
diff --git a/awk/rawk/scratch/debug_findindex_simple.rawk b/awk/rawk/scratch/debug_findindex_simple.rawk
new file mode 100644
index 0000000..ae87d03
--- /dev/null
+++ b/awk/rawk/scratch/debug_findindex_simple.rawk
@@ -0,0 +1,34 @@
+BEGIN {
+    print "=== Simple findIndex Debug ==="
+}
+
+RAWK {
+    $is_positive_test = (x) -> {
+        return x > 0;
+    };
+}
+
+{
+    # Simple test data
+    data[1] = -1;
+    data[2] = 0;
+    data[3] = 5;
+    
+    print "Data:";
+    for (i = 1; i <= 3; i++) {
+        result = is_positive_test(data[i]);
+        print "  data[" i "] = " data[i] " (positive: " result ")";
+    }
+    
+    # Manual findIndex
+    print "Manual findIndex:";
+    for (i = 1; i <= 3; i++) {
+        if (is_positive_test(data[i])) {
+            print "  First positive at index " i;
+            break;
+        }
+    }
+    
+    print "Test completed";
+    exit 0;
+} 
\ No newline at end of file