aboutsummaryrefslogtreecommitdiff
path: root/src/test/data/script_valid.json
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2013-07-23 05:12:38 -0400
committerPeter Todd <pete@petertodd.org>2013-07-23 05:12:38 -0400
commitaff83e9c028ad1f05886ae3079e40e659df5be41 (patch)
treeda17e9a86df768d6d5c74957ff213c7ae0c61b08 /src/test/data/script_valid.json
parent0a740650a52a21b7d82b43524017c87643af3224 (diff)
Add unittests for multiple ELSEs in a row
IF ELSE ELSE ENDIF is a valid construct; execution or non-execution inverts on each ELSE encountered.
Diffstat (limited to 'src/test/data/script_valid.json')
-rw-r--r--src/test/data/script_valid.json15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json
index 58682d3875..cc56a310ae 100644
--- a/src/test/data/script_valid.json
+++ b/src/test/data/script_valid.json
@@ -34,6 +34,21 @@
["1 0", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
["0 1", "NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF"],
+["0", "IF 0 ELSE 1 ELSE 0 ENDIF", "Multiple ELSE's are valid and executed inverts on each ELSE encountered"],
+["1", "IF 1 ELSE 0 ELSE ENDIF"],
+["1", "IF ELSE 0 ELSE 1 ENDIF"],
+["1", "IF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL"],
+["'' 1", "IF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL"],
+
+["1", "NOTIF 0 ELSE 1 ELSE 0 ENDIF", "Multiple ELSE's are valid and execution inverts on each ELSE encountered"],
+["0", "NOTIF 1 ELSE 0 ELSE ENDIF"],
+["0", "NOTIF ELSE 0 ELSE 1 ENDIF"],
+["0", "NOTIF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL"],
+["'' 0", "NOTIF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL"],
+
+["0", "IF 1 IF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 1 IF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL", "Nested ELSE ELSE"],
+["1", "NOTIF 0 NOTIF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 0 NOTIF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL"],
+
["0", "IF RETURN ENDIF 1", "RETURN only works if executed"],
["1 1", "VERIFY"],