about summary refs log tree commit diff stats
path: root/js/scripting-lang/scratch_tests/test_complex_validation_only.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scratch_tests/test_complex_validation_only.txt')
-rw-r--r--js/scripting-lang/scratch_tests/test_complex_validation_only.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/scripting-lang/scratch_tests/test_complex_validation_only.txt b/js/scripting-lang/scratch_tests/test_complex_validation_only.txt
new file mode 100644
index 0000000..d4e0a4a
--- /dev/null
+++ b/js/scripting-lang/scratch_tests/test_complex_validation_only.txt
@@ -0,0 +1,14 @@
+/* Test just the complex validation part */
+
+/* Complex function for testing */
+complex_validation : x y -> (x > 0) and (y > 0) and (x + y > 10);
+
+/* Using complex function in pattern */
+validate_pair : x y ->
+  when (complex_validation x y) is
+    true then "valid pair"
+    false then "invalid pair";
+
+/* Test complex validation */
+valid_pair : validate_pair 5 8;
+..out valid_pair; 
\ No newline at end of file