mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Final test batch and associated fixes
This commit is contained in:
parent
050c84921c
commit
43a745a7a9
66 changed files with 1233 additions and 51 deletions
24
test/tests/checkpoint merging mutable value.ans
Normal file
24
test/tests/checkpoint merging mutable value.ans
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
:l = *[1,2]
|
||||
|
||||
:@$ post run check
|
||||
|1,2,3,4: {l}
|
||||
|
||||
|1,2: {l}
|
||||
|
||||
l!insert(3)
|
||||
|
||||
|1,2,3: {l}
|
||||
|
||||
merge branch!
|
||||
|
||||
l!insert(4)
|
||||
|
||||
|1,2,3,4: {l}
|
||||
|
||||
merge branch!
|
||||
|
||||
l!insert(5)
|
||||
|
||||
|1,2,3,4,5: {l}
|
||||
|
||||
error("cancel merge")
|
||||
24
test/tests/checkpoint merging variable.ans
Normal file
24
test/tests/checkpoint merging variable.ans
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
:l = 1
|
||||
|
||||
:@$ post run check
|
||||
|3: {l}
|
||||
|
||||
|1: {l}
|
||||
|
||||
l = 2
|
||||
|
||||
|2: {l}
|
||||
|
||||
merge branch!
|
||||
|
||||
l = 3
|
||||
|
||||
|3: {l}
|
||||
|
||||
merge branch!
|
||||
|
||||
l = 4
|
||||
|
||||
|4: {l}
|
||||
|
||||
error("cancel merge")
|
||||
21
test/tests/commit.ans
Normal file
21
test/tests/commit.ans
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
:bar = "bar"!script($_)
|
||||
var = 2
|
||||
|
||||
|before: {var}
|
||||
|
||||
run in new branch("parallel!")
|
||||
|
||||
#foo!checkpoint($_)
|
||||
|checkpoint
|
||||
|
||||
|after: {var}
|
||||
|
||||
run in new branch("parallel!")
|
||||
bar.:var = 5
|
||||
|
||||
:@$ parallel
|
||||
|parallel: {bar.var}
|
||||
|
||||
merge branch!
|
||||
|
||||
bar!
|
||||
3
test/tests/custom event.ans
Normal file
3
test/tests/custom event.ans
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|ah
|
||||
wait(5)
|
||||
|ho
|
||||
5
test/tests/function conflict.ans
Normal file
5
test/tests/function conflict.ans
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
:$ f(a, b) 0
|
||||
|
||||
:$ f(x) 0
|
||||
|
||||
:$ f(a, b) 0
|
||||
18
test/tests/function cycle.ans
Normal file
18
test/tests/function cycle.ans
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
:$ f
|
||||
:a = "a"!script($_)
|
||||
| a
|
||||
:b = "b"!script($_)
|
||||
| b
|
||||
:c = "c"!script($_)
|
||||
| c
|
||||
cycle([a,b,c])
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
18
test/tests/function next.ans
Normal file
18
test/tests/function next.ans
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
:$ f
|
||||
:a = "a"!script($_)
|
||||
| a
|
||||
:b = "b"!script($_)
|
||||
| b
|
||||
:c = "c"!script($_)
|
||||
| c
|
||||
next([a, b, c])
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
18
test/tests/function random.ans
Normal file
18
test/tests/function random.ans
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
:$ f
|
||||
:a = "a"!script($_)
|
||||
| a
|
||||
:b = "b"!script($_)
|
||||
| b
|
||||
:c = "c"!script($_)
|
||||
| c
|
||||
random([a,b,c])
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
|
||||
f!
|
||||
20
test/tests/interrupt callback nested paragraph.ans
Normal file
20
test/tests/interrupt callback nested paragraph.ans
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
:oh = $
|
||||
|no
|
||||
|
||||
oh.:bar = "bar"!script($_)
|
||||
:leave = $
|
||||
|in interrupt: {var}
|
||||
|
||||
var = 2
|
||||
|
||||
|before: {var}
|
||||
|
||||
interrupt("leave!")
|
||||
|
||||
#foo!checkpoint($_)
|
||||
|checkpoint
|
||||
|
||||
|after: {var}
|
||||
oh.bar.:var = 5
|
||||
|
||||
oh.bar!
|
||||
20
test/tests/interrupt callback nested.ans
Normal file
20
test/tests/interrupt callback nested.ans
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
:$ leave
|
||||
|in interrupt: {oh.bar.var}
|
||||
|
||||
:$ oh
|
||||
|no
|
||||
|
||||
oh.:bar = "bar"!script($_)
|
||||
var = 2
|
||||
|
||||
|before: {var}
|
||||
|
||||
interrupt("leave!")
|
||||
|
||||
#foo!checkpoint($_)
|
||||
|checkpoint
|
||||
|
||||
|after: {var}
|
||||
oh.bar.:var = 5
|
||||
|
||||
oh.bar!
|
||||
18
test/tests/interrupt callback.ans
Normal file
18
test/tests/interrupt callback.ans
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
:bar = "bar"!script($_)
|
||||
:var = 5
|
||||
|
||||
var = 2
|
||||
|
||||
:$ leave
|
||||
|in interrupt: {var}
|
||||
|
||||
|before: {var}
|
||||
|
||||
interrupt("leave!")
|
||||
|
||||
#foo!checkpoint($_)
|
||||
|checkpoint
|
||||
|
||||
|after: {var}
|
||||
|
||||
bar!
|
||||
18
test/tests/interrupt no callback.ans
Normal file
18
test/tests/interrupt no callback.ans
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
:bar = "bar"!script($_)
|
||||
:var = 5
|
||||
|
||||
var = 2
|
||||
|
||||
:$ leave
|
||||
|in interrupt: {var}
|
||||
|
||||
|before: {var}
|
||||
|
||||
interrupt()
|
||||
|
||||
#foo!checkpoint($_)
|
||||
|checkpoint
|
||||
|
||||
|after: {var}
|
||||
|
||||
bar!
|
||||
32
test/tests/map index accross checkpoints.ans
Normal file
32
test/tests/map index accross checkpoints.ans
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
:f = "f"!script($_)
|
||||
:x = *{4}
|
||||
|
||||
|x={x}
|
||||
|
||||
:a = {1,2,3,(x):4}
|
||||
|
||||
:c = a
|
||||
|
||||
|1={a==c}
|
||||
|
||||
|a(x)={a(x)}
|
||||
|
||||
#ch a!checkpoint
|
||||
|
||||
|a(x)={a(x)}
|
||||
|
||||
#ch b!checkpoint
|
||||
|
||||
x(1) = 3
|
||||
|
||||
|a(x)={a(x)}
|
||||
|
||||
#ch c!checkpoint
|
||||
|
||||
|a(x)={a(x)}
|
||||
|
||||
x={4}
|
||||
|
||||
|no={a(x)}
|
||||
|
||||
f!
|
||||
17
test/tests/merge nested mutable bis.ans
Normal file
17
test/tests/merge nested mutable bis.ans
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
:a = *[1]
|
||||
:b = *[2]
|
||||
:f = "f"!script($_)
|
||||
a!insert(b)
|
||||
|
||||
#c!checkpoint
|
||||
|
||||
b!insert(3)
|
||||
|
||||
#d!checkpoint
|
||||
|
||||
b!insert(4)
|
||||
|
||||
:@$ post run check
|
||||
|[1,[2,3,4]]: {a}
|
||||
|
||||
f!
|
||||
19
test/tests/merge nested mutable error bis.ans
Normal file
19
test/tests/merge nested mutable error bis.ans
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
:a = *[1]
|
||||
:b = *[2]
|
||||
:f = "f"!script($_)
|
||||
a!insert(b)
|
||||
|
||||
#c!checkpoint
|
||||
|
||||
b!insert(3)
|
||||
|
||||
#d!checkpoint
|
||||
|
||||
b!insert(4)
|
||||
|
||||
error("abort")
|
||||
|
||||
:@$ post run check
|
||||
|[1,[2,3]]: {a}
|
||||
|
||||
f!
|
||||
19
test/tests/merge nested mutable error.ans
Normal file
19
test/tests/merge nested mutable error.ans
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
:a = *[1]
|
||||
:b = *[2]
|
||||
:f = "f"!script($_)
|
||||
a!insert(b)
|
||||
|
||||
#c!checkpoint
|
||||
|
||||
b!insert(3)
|
||||
|
||||
#d!checkpoint
|
||||
|
||||
a!insert(4)
|
||||
|
||||
error("abort")
|
||||
|
||||
:@$ post run check
|
||||
|[1,[2,3]]: {a}
|
||||
|
||||
f!
|
||||
17
test/tests/merge nested mutable.ans
Normal file
17
test/tests/merge nested mutable.ans
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
:a = *[1]
|
||||
:b = *[2]
|
||||
:f = "f"!script($_)
|
||||
a!insert(b)
|
||||
|
||||
#c!checkpoint
|
||||
|
||||
b!insert(3)
|
||||
|
||||
#d!checkpoint
|
||||
|
||||
a!insert(4)
|
||||
|
||||
:@$ post run check
|
||||
|[1,[2,3],4]: {a}
|
||||
|
||||
f!
|
||||
47
test/tests/scope checkpoint mutable bis error.ans
Normal file
47
test/tests/scope checkpoint mutable bis error.ans
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
:x = *[99]
|
||||
|
||||
:l = *[1,x]
|
||||
|
||||
:n = 0
|
||||
|
||||
:$ f(t)
|
||||
t!insert(len(l)+1)
|
||||
|
||||
|f1: {l} {t}
|
||||
|
||||
|CHECK
|
||||
merge branch!
|
||||
|
||||
n < 1 ~
|
||||
|REC
|
||||
|
||||
n += 1
|
||||
f(t)
|
||||
|
||||
|END REC
|
||||
|
||||
|f2: {l}
|
||||
|
||||
|CHECK 2
|
||||
merge branch!
|
||||
|
||||
t!insert(len(t)+1)
|
||||
|
||||
t(2)!insert(len(l)+1)
|
||||
|
||||
error("t")
|
||||
|
||||
|f3: {l} {t}
|
||||
|
||||
:@$ post run check
|
||||
|AFTER ERROR
|
||||
|
||||
|l: {l}
|
||||
|
||||
f(l)
|
||||
|
||||
|FINAL
|
||||
|
||||
|l: {l}
|
||||
|
||||
|x: {x}
|
||||
40
test/tests/scope checkpoint mutable bis.ans
Normal file
40
test/tests/scope checkpoint mutable bis.ans
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
:x = *[99]
|
||||
|
||||
:l = *[1,x]
|
||||
|
||||
:n = 0
|
||||
|
||||
:$ f(t)
|
||||
t!insert(len(l)+1)
|
||||
|
||||
|f1: {l} {t}
|
||||
|
||||
|CHECK
|
||||
merge branch!
|
||||
|
||||
n < 1 ~
|
||||
|REC
|
||||
|
||||
n += 1
|
||||
f(t)
|
||||
|
||||
|END REC
|
||||
|
||||
|f2: {l}
|
||||
|
||||
|CHECK 2
|
||||
merge branch!
|
||||
|
||||
t!insert(len(t)+1)
|
||||
|
||||
t(2)!insert(len(l)+1)
|
||||
|
||||
|f3: {l} {t}
|
||||
|
||||
f(l)
|
||||
|
||||
|FINAL
|
||||
|
||||
|l: {l}
|
||||
|
||||
|x: {x}
|
||||
36
test/tests/scope checkpoint mutable error.ans
Normal file
36
test/tests/scope checkpoint mutable error.ans
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
:l = *[1]
|
||||
|
||||
:n = 0
|
||||
|
||||
:$ f(t)
|
||||
t!insert(len(l)+1)
|
||||
|
||||
|f1: {l} {t}
|
||||
|
||||
|CHECK
|
||||
merge branch!
|
||||
|
||||
n < 1 ~
|
||||
|REC
|
||||
|
||||
n += 1
|
||||
f(t)
|
||||
|
||||
|END REC
|
||||
|
||||
t!insert(len(t)+1)
|
||||
|
||||
error("t")
|
||||
|
||||
|f2: {l}
|
||||
|
||||
:@$ post run check
|
||||
|AFTER ERROR
|
||||
|
||||
|l: {l}
|
||||
|
||||
f(l)
|
||||
|
||||
|FINAL
|
||||
|
||||
|l: {l}
|
||||
49
test/tests/scope checkpoint mutable ter error.ans
Normal file
49
test/tests/scope checkpoint mutable ter error.ans
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
:x = *[99]
|
||||
|
||||
:l = *[1,x]
|
||||
|
||||
:n = 0
|
||||
|
||||
:$ f(t)
|
||||
t!insert(len(l)+1)
|
||||
|
||||
|f1: {l} {t}
|
||||
|
||||
|CHECK
|
||||
merge branch!
|
||||
|
||||
n < 1 ~
|
||||
|REC
|
||||
|
||||
n += 1
|
||||
f(t)
|
||||
|
||||
|END REC
|
||||
|
||||
x!insert(12)
|
||||
|
||||
|f2: {l}
|
||||
|
||||
|CHECK 2
|
||||
merge branch!
|
||||
|
||||
t!insert(len(t)+1)
|
||||
|
||||
t(2)!insert(len(l)+1)
|
||||
|
||||
error("t")
|
||||
|
||||
|f3: {l} {t}
|
||||
|
||||
:@$ post run check
|
||||
|AFTER ERROR
|
||||
|
||||
|l: {l}
|
||||
|
||||
f(l)
|
||||
|
||||
|FINAL
|
||||
|
||||
|l: {l}
|
||||
|
||||
|x: {x}
|
||||
42
test/tests/scope checkpoint mutable ter.ans
Normal file
42
test/tests/scope checkpoint mutable ter.ans
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
:x = *[99]
|
||||
|
||||
:l = *[1,x]
|
||||
|
||||
:n = 0
|
||||
|
||||
:$ f(t)
|
||||
t!insert(len(l)+1)
|
||||
|
||||
|f1: {l} {t}
|
||||
|
||||
|CHECK
|
||||
merge branch!
|
||||
|
||||
n < 1 ~
|
||||
|REC
|
||||
|
||||
n += 1
|
||||
f(t)
|
||||
|
||||
|END REC
|
||||
|
||||
x!insert(12)
|
||||
|
||||
|f2: {l}
|
||||
|
||||
|CHECK 2
|
||||
merge branch!
|
||||
|
||||
t!insert(len(t)+1)
|
||||
|
||||
t(2)!insert(len(l)+1)
|
||||
|
||||
|f3: {l} {t}
|
||||
|
||||
f(l)
|
||||
|
||||
|FINAL
|
||||
|
||||
|l: {l}
|
||||
|
||||
|x: {x}
|
||||
29
test/tests/scope checkpoint mutable.ans
Normal file
29
test/tests/scope checkpoint mutable.ans
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
:l = *[1]
|
||||
|
||||
:n = 0
|
||||
|
||||
:$ f(t)
|
||||
t!insert(len(l)+1)
|
||||
|
||||
|f1: {l} {t}
|
||||
|
||||
|CHECK
|
||||
merge branch!
|
||||
|
||||
n < 1 ~
|
||||
|REC
|
||||
|
||||
n += 1
|
||||
f(t)
|
||||
|
||||
|END REC
|
||||
|
||||
t!insert(len(t)+1)
|
||||
|
||||
|f2: {l}
|
||||
|
||||
f(l)
|
||||
|
||||
|FINAL
|
||||
|
||||
|l: {l}
|
||||
12
test/tests/seen checkpoint resume.ans
Normal file
12
test/tests/seen checkpoint resume.ans
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
: fn = "fn"!script($_)
|
||||
|{run}
|
||||
|
||||
#a!checkpoint
|
||||
|
||||
|a: {run}
|
||||
|
||||
fn!from(#a)
|
||||
|
||||
fn!from(#a)
|
||||
|
||||
fn!from(#a)
|
||||
7
test/tests/unseen line.ans
Normal file
7
test/tests/unseen line.ans
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
: x = "x"!script($_)
|
||||
|a
|
||||
run == 0 ~ |seen only once
|
||||
|b
|
||||
|
||||
x!
|
||||
x!
|
||||
Loading…
Add table
Add a link
Reference in a new issue