Skip to content

Commit 4511810

Browse files
Add tests for RUN.
1 parent 1d1c63f commit 4511810

7 files changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RUN("", "")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RUN()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RUN(0d1)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
INT: marker = 0d1
2+
RUN("")
3+
ASSERT(EQ(marker, 0d1))
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
INT: step = 0d0
2+
BOOL: caught = FALSE
3+
4+
TRY{
5+
RUN("step = 0d1; IF(TRUE){")
6+
ASSERT(FALSE)
7+
} CATCH {
8+
caught = TRUE
9+
}
10+
11+
ASSERT(caught)
12+
ASSERT(EQ(step, 0d0))
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
INT: step = 0d0
2+
BOOL: caught = FALSE
3+
4+
TRY{
5+
RUN("step = 0d1; ASSERT(FALSE); step = 0d2")
6+
ASSERT(FALSE)
7+
} CATCH {
8+
caught = TRUE
9+
}
10+
11+
ASSERT(caught)
12+
ASSERT(EQ(step, 0d1))
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
INT: counter = 0d2
2+
3+
RUN("ASSERT(EQ(counter, 0d2)); counter = ADD(counter, 0d3)")
4+
ASSERT(EQ(counter, 0d5))
5+
6+
RUN("INT: created = SUB(counter, 0d1)")
7+
ASSERT(EQ(created, 0d4))

0 commit comments

Comments
 (0)