mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-09-11 03:45:29 +03:00
Add guide examples to tests
This commit is contained in:
parent
ef2198e3c9
commit
b0fd8dfb91
4
GUIDE.md
4
GUIDE.md
@ -233,7 +233,7 @@ def slow_mul2(n):
|
|||||||
case 0:
|
case 0:
|
||||||
return 0
|
return 0
|
||||||
case _:
|
case _:
|
||||||
return 2 * slow_mul2(n-1)
|
return 2 + slow_mul2(n-1)
|
||||||
```
|
```
|
||||||
|
|
||||||
The `if-else` syntax is a third option to branch, other than `match` and
|
The `if-else` syntax is a third option to branch, other than `match` and
|
||||||
@ -397,7 +397,7 @@ def enum(tree):
|
|||||||
rgt: tree.rgt(idx * 2 + 1),
|
rgt: tree.rgt(idx * 2 + 1),
|
||||||
}
|
}
|
||||||
case Tree/Leaf:
|
case Tree/Leaf:
|
||||||
return (idx, tree.val)
|
return Tree/Leaf { val: (idx, tree.val) }
|
||||||
|
|
||||||
def main:
|
def main:
|
||||||
tree = Tree/Node {
|
tree = Tree/Node {
|
||||||
|
11
tests/golden_tests/run_file/guide_bend_7tree.bend
Normal file
11
tests/golden_tests/run_file/guide_bend_7tree.bend
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
type Tree:
|
||||||
|
Node { ~lft, ~rgt }
|
||||||
|
Leaf { val }
|
||||||
|
|
||||||
|
def main():
|
||||||
|
bend x = 0:
|
||||||
|
when x < 3:
|
||||||
|
tree = Tree/Node { lft: fork(x + 1), rgt: fork(x + 1) }
|
||||||
|
else:
|
||||||
|
tree = Tree/Leaf { val: 7 }
|
||||||
|
return tree
|
10
tests/golden_tests/run_file/guide_bend_sequential.bend
Normal file
10
tests/golden_tests/run_file/guide_bend_sequential.bend
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
def foo(_):
|
||||||
|
bend idx = 0:
|
||||||
|
when idx < 10:
|
||||||
|
sum = idx + fork(idx + 1)
|
||||||
|
else:
|
||||||
|
sum = 0
|
||||||
|
return sum
|
||||||
|
|
||||||
|
def main:
|
||||||
|
return foo(*)
|
7
tests/golden_tests/run_file/guide_bend_sum_tree.bend
Normal file
7
tests/golden_tests/run_file/guide_bend_sum_tree.bend
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
def main():
|
||||||
|
bend d = 0, i = 0:
|
||||||
|
when d < 15: # in the guide its 28, but that takes way too long
|
||||||
|
sum = fork(d+1, i*2+0) + fork(d+1, i*2+1)
|
||||||
|
else:
|
||||||
|
sum = i
|
||||||
|
return sum
|
60
tests/golden_tests/run_file/guide_bitonic_sort.bend
Normal file
60
tests/golden_tests/run_file/guide_bitonic_sort.bend
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
def gen(d, x):
|
||||||
|
switch d:
|
||||||
|
case 0:
|
||||||
|
return x
|
||||||
|
case _:
|
||||||
|
return (gen(d-1, x * 2 + 1), gen(d-1, x * 2))
|
||||||
|
|
||||||
|
def sum(d, t):
|
||||||
|
switch d:
|
||||||
|
case 0:
|
||||||
|
return t
|
||||||
|
case _:
|
||||||
|
(t.a, t.b) = t
|
||||||
|
return sum(d-1, t.a) + sum(d-1, t.b)
|
||||||
|
|
||||||
|
def swap(s, a, b):
|
||||||
|
switch s:
|
||||||
|
case 0:
|
||||||
|
return (a,b)
|
||||||
|
case _:
|
||||||
|
return (b,a)
|
||||||
|
|
||||||
|
def warp(d, s, a, b):
|
||||||
|
switch d:
|
||||||
|
case 0:
|
||||||
|
return swap(s ^ (a > b), a, b)
|
||||||
|
case _:
|
||||||
|
(a.a,a.b) = a
|
||||||
|
(b.a,b.b) = b
|
||||||
|
(A.a,A.b) = warp(d-1, s, a.a, b.a)
|
||||||
|
(B.a,B.b) = warp(d-1, s, a.b, b.b)
|
||||||
|
return ((A.a,B.a),(A.b,B.b))
|
||||||
|
|
||||||
|
def flow(d, s, t):
|
||||||
|
switch d:
|
||||||
|
case 0:
|
||||||
|
return t
|
||||||
|
case _:
|
||||||
|
(t.a, t.b) = t
|
||||||
|
return down(d, s, warp(d-1, s, t.a, t.b))
|
||||||
|
|
||||||
|
def down(d,s,t):
|
||||||
|
switch d:
|
||||||
|
case 0:
|
||||||
|
return t
|
||||||
|
case _:
|
||||||
|
(t.a, t.b) = t
|
||||||
|
return (flow(d-1, s, t.a), flow(d-1, s, t.b))
|
||||||
|
|
||||||
|
def sort(d, s, t):
|
||||||
|
switch d:
|
||||||
|
case 0:
|
||||||
|
return t
|
||||||
|
case _:
|
||||||
|
(t.a, t.b) = t
|
||||||
|
return flow(d, s, (sort(d-1, 0, t.a), sort(d-1, 1, t.b)))
|
||||||
|
|
||||||
|
def main:
|
||||||
|
# In the guide it's 18
|
||||||
|
return sum(10, sort(10, 0, gen(10, 0)))
|
13
tests/golden_tests/run_file/guide_circle_area.bend
Normal file
13
tests/golden_tests/run_file/guide_circle_area.bend
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
type Shape:
|
||||||
|
Circle { radius }
|
||||||
|
Rectangle { width, height }
|
||||||
|
|
||||||
|
def area(shape):
|
||||||
|
match shape:
|
||||||
|
case Shape/Circle:
|
||||||
|
return 3.14 * shape.radius ** 2.0
|
||||||
|
case Shape/Rectangle:
|
||||||
|
return shape.width * shape.height
|
||||||
|
|
||||||
|
def main:
|
||||||
|
return area(Shape/Circle { radius: 10.0 })
|
7
tests/golden_tests/run_file/guide_distance_4args.bend
Normal file
7
tests/golden_tests/run_file/guide_distance_4args.bend
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
def distance(ax, ay, bx, by):
|
||||||
|
dx = bx - ax
|
||||||
|
dy = by - ay
|
||||||
|
return (dx * dx + dy * dy) ** 0.5
|
||||||
|
|
||||||
|
def main():
|
||||||
|
return distance(10.0, 10.0, 20.0, 20.0)
|
11
tests/golden_tests/run_file/guide_distance_obj.bend
Normal file
11
tests/golden_tests/run_file/guide_distance_obj.bend
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
object V2 { x, y }
|
||||||
|
|
||||||
|
def distance(a, b):
|
||||||
|
open V2: a
|
||||||
|
open V2: b
|
||||||
|
dx = b.x - a.x
|
||||||
|
dy = b.y - a.y
|
||||||
|
return (dx * dx + dy * dy) ** 0.5
|
||||||
|
|
||||||
|
def main():
|
||||||
|
return distance(V2 { x: 10.0, y: 10.0 }, V2 { x: 20.0, y: 20.0 })
|
9
tests/golden_tests/run_file/guide_distance_tup.bend
Normal file
9
tests/golden_tests/run_file/guide_distance_tup.bend
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
def distance(a, b):
|
||||||
|
(ax, ay) = a
|
||||||
|
(bx, by) = b
|
||||||
|
dx = bx - ax
|
||||||
|
dy = by - ay
|
||||||
|
return (dx * dx + dy * dy) ** 0.5
|
||||||
|
|
||||||
|
def main():
|
||||||
|
return distance((10.0, 10.0), (20.0, 20.0))
|
21
tests/golden_tests/run_file/guide_enumerate.bend
Normal file
21
tests/golden_tests/run_file/guide_enumerate.bend
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
type Tree:
|
||||||
|
Node { ~lft, ~rgt }
|
||||||
|
Leaf { val }
|
||||||
|
|
||||||
|
def enum(tree):
|
||||||
|
idx = 0
|
||||||
|
fold tree with idx:
|
||||||
|
case Tree/Node:
|
||||||
|
return Tree/Node {
|
||||||
|
lft: tree.lft(idx * 2 + 0),
|
||||||
|
rgt: tree.rgt(idx * 2 + 1),
|
||||||
|
}
|
||||||
|
case Tree/Leaf:
|
||||||
|
return Tree/Leaf { val: (idx, tree.val) }
|
||||||
|
|
||||||
|
def main:
|
||||||
|
tree = Tree/Node {
|
||||||
|
lft: Tree/Node { lft: Tree/Leaf { val: 1 }, rgt: Tree/Leaf { val: 2 }, },
|
||||||
|
rgt: Tree/Node { lft: Tree/Leaf { val: 3 }, rgt: Tree/Leaf { val: 4 }, }
|
||||||
|
}
|
||||||
|
return enum(tree)
|
8
tests/golden_tests/run_file/guide_if_age.bend
Normal file
8
tests/golden_tests/run_file/guide_if_age.bend
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
def am_i_old(age):
|
||||||
|
if age < 18:
|
||||||
|
return "you're a kid"
|
||||||
|
else:
|
||||||
|
return "you're an adult"
|
||||||
|
|
||||||
|
def main():
|
||||||
|
return am_i_old(32)
|
8
tests/golden_tests/run_file/guide_is_even_num.bend
Normal file
8
tests/golden_tests/run_file/guide_is_even_num.bend
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
def is_even(n):
|
||||||
|
if n % 2 == 0:
|
||||||
|
return 1
|
||||||
|
else:
|
||||||
|
return 0
|
||||||
|
|
||||||
|
def main:
|
||||||
|
return is_even(7)
|
8
tests/golden_tests/run_file/guide_is_even_str.bend
Normal file
8
tests/golden_tests/run_file/guide_is_even_str.bend
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
def is_even(x):
|
||||||
|
if x % 2 == 0:
|
||||||
|
return "even"
|
||||||
|
else:
|
||||||
|
return "odd"
|
||||||
|
|
||||||
|
def main:
|
||||||
|
return is_even(7)
|
3
tests/golden_tests/run_file/guide_list_ctrs.bend
Normal file
3
tests/golden_tests/run_file/guide_list_ctrs.bend
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
def main:
|
||||||
|
my_list = List/Cons { head: 1, tail: List/Cons { head: 2, tail: List/Cons { head: 3, tail: List/Nil }}}
|
||||||
|
return my_list
|
7
tests/golden_tests/run_file/guide_list_match.bend
Normal file
7
tests/golden_tests/run_file/guide_list_match.bend
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
def main:
|
||||||
|
my_list = [1, 2, 3]
|
||||||
|
match my_list:
|
||||||
|
case List/Cons:
|
||||||
|
return my_list.head
|
||||||
|
case List/Nil:
|
||||||
|
return 0
|
3
tests/golden_tests/run_file/guide_list_sugar.bend
Normal file
3
tests/golden_tests/run_file/guide_list_sugar.bend
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
def main:
|
||||||
|
my_list = [1, 2, 3]
|
||||||
|
return my_list
|
3
tests/golden_tests/run_file/guide_mul2_inline.bend
Normal file
3
tests/golden_tests/run_file/guide_mul2_inline.bend
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
def main:
|
||||||
|
mul_2 = lambda x: x * 2
|
||||||
|
return mul_2(7)
|
9
tests/golden_tests/run_file/guide_mul2_rec.bend
Normal file
9
tests/golden_tests/run_file/guide_mul2_rec.bend
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
def slow_mul2(n):
|
||||||
|
switch n:
|
||||||
|
case 0:
|
||||||
|
return 0
|
||||||
|
case _:
|
||||||
|
return 2 + slow_mul2(n-1)
|
||||||
|
|
||||||
|
def main:
|
||||||
|
return slow_mul2(7)
|
23
tests/golden_tests/run_file/guide_shader_dummy.bend
Normal file
23
tests/golden_tests/run_file/guide_shader_dummy.bend
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# given a shader, returns a square image
|
||||||
|
def render(depth, shader):
|
||||||
|
bend d = 0, i = 0:
|
||||||
|
when d < depth:
|
||||||
|
color = (fork(d+1, i*2+0), fork(d+1, i*2+1))
|
||||||
|
else:
|
||||||
|
width = depth / 2
|
||||||
|
color = shader(i % width, i / width)
|
||||||
|
return color
|
||||||
|
|
||||||
|
# given a position, returns a color
|
||||||
|
# for this demo, it just busy loops
|
||||||
|
def demo_shader(x, y):
|
||||||
|
bend i = 0:
|
||||||
|
when i < 10:
|
||||||
|
color = fork(i + 1)
|
||||||
|
else:
|
||||||
|
color = 0x000001
|
||||||
|
return color
|
||||||
|
|
||||||
|
# renders a 256x256 image using demo_shader
|
||||||
|
def main:
|
||||||
|
return render(5, demo_shader)
|
17
tests/golden_tests/run_file/guide_sum.bend
Normal file
17
tests/golden_tests/run_file/guide_sum.bend
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
type Tree:
|
||||||
|
Node { ~lft, ~rgt }
|
||||||
|
Leaf { val }
|
||||||
|
|
||||||
|
def sum(tree):
|
||||||
|
fold tree:
|
||||||
|
case Tree/Node:
|
||||||
|
return tree.lft + tree.rgt
|
||||||
|
case Tree/Leaf:
|
||||||
|
return tree.val
|
||||||
|
|
||||||
|
def main:
|
||||||
|
tree = Tree/Node {
|
||||||
|
lft: Tree/Node { lft: Tree/Leaf { val: 1 }, rgt: Tree/Leaf { val: 2 } },
|
||||||
|
rgt: Tree/Node { lft: Tree/Leaf { val: 3 }, rgt: Tree/Leaf { val: 4 } }
|
||||||
|
}
|
||||||
|
return sum(tree)
|
@ -4,4 +4,4 @@ input_file: tests/golden_tests/cli/net_size_too_large.bend
|
|||||||
---
|
---
|
||||||
[4m[1m[31mErrors:[0m
|
[4m[1m[31mErrors:[0m
|
||||||
[1mIn definition '[4mRadix[0m[1m':[0m
|
[1mIn definition '[4mRadix[0m[1m':[0m
|
||||||
Definition is too large for hvm (size=144, max size=64). Please break it into smaller pieces.
|
Definition is too large for hvm (size=120, max size=64). Please break it into smaller pieces.
|
||||||
|
@ -16,7 +16,7 @@ input_file: tests/golden_tests/cli/no_check_net_size.bend
|
|||||||
@Gen.go__C0 = a
|
@Gen.go__C0 = a
|
||||||
& @Arr/Leaf ~ a
|
& @Arr/Leaf ~ a
|
||||||
|
|
||||||
@Gen.go__C1 = ({a d} ({$([*2] $([|] $(1 e))) $([*2] b)} g))
|
@Gen.go__C1 = ({a d} ({$([*2] $([|1] e)) $([*2] b)} g))
|
||||||
& @Arr/Node ~ (c (f g))
|
& @Arr/Node ~ (c (f g))
|
||||||
&! @Gen.go ~ (a (b c))
|
&! @Gen.go ~ (a (b c))
|
||||||
&! @Gen.go ~ (d (e f))
|
&! @Gen.go ~ (d (e f))
|
||||||
@ -71,7 +71,7 @@ input_file: tests/golden_tests/cli/no_check_net_size.bend
|
|||||||
|
|
||||||
@Merge__C9 = ((@Merge__C4 a) a)
|
@Merge__C9 = ((@Merge__C4 a) a)
|
||||||
|
|
||||||
@Radix = ({$([&] $(8388608 a)) {$([&] $(4194304 b)) {$([&] $(2097152 c)) {$([&] $(1048576 d)) {$([&] $(524288 e)) {$([&] $(262144 f)) {$([&] $(131072 g)) {$([&] $(65536 h)) {$([&] $(32768 i)) {$([&] $(16384 j)) {$([&] $(8192 k)) {$([&] $(4096 l)) {$([&] $(2048 m)) {$([&] $(1024 n)) {$([&] $(512 o)) {$([&] $(256 p)) {$([&] $(128 q)) {$([&] $(64 r)) {$([&] $(32 s)) {$([&] $(16 t)) {$([&] $(8 u)) {$([&] $(4 v)) {$([&] $(2 w)) $([&] $(1 x))}}}}}}}}}}}}}}}}}}}}}}} vb)
|
@Radix = ({$([&8388608] a) {$([&4194304] b) {$([&2097152] c) {$([&1048576] d) {$([&524288] e) {$([&262144] f) {$([&131072] g) {$([&65536] h) {$([&32768] i) {$([&16384] j) {$([&8192] k) {$([&4096] l) {$([&2048] m) {$([&1024] n) {$([&512] o) {$([&256] p) {$([&128] q) {$([&64] r) {$([&32] s) {$([&16] t) {$([&8] u) {$([&4] v) {$([&2] w) $([&1] x)}}}}}}}}}}}}}}}}}}}}}}} vb)
|
||||||
& @Swap ~ (a (ub (@Map_/Free vb)))
|
& @Swap ~ (a (ub (@Map_/Free vb)))
|
||||||
& @Swap ~ (b (tb (@Map_/Free ub)))
|
& @Swap ~ (b (tb (@Map_/Free ub)))
|
||||||
& @Swap ~ (c (sb (@Map_/Free tb)))
|
& @Swap ~ (c (sb (@Map_/Free tb)))
|
||||||
|
@ -3,4 +3,4 @@ source: tests/golden_tests.rs
|
|||||||
input_file: tests/golden_tests/compile_file/op2.bend
|
input_file: tests/golden_tests/compile_file/op2.bend
|
||||||
---
|
---
|
||||||
@main = a
|
@main = a
|
||||||
& $(1 $([=2] $([&] $(3 $([|] $(4 $([<5] $([>6] $([:/7] $([*8] $([:-9] $([+10] $([:%11] a))))))))))))) ~ [!0]
|
& $(1 $([=2] $([&3] $([|4] $([<5] $([>6] $([:/7] $([*8] $([:-9] $([+10] $([:%11] a))))))))))) ~ [!0]
|
||||||
|
9
tests/snapshots/run_file__guide_bend_7tree.bend.snap
Normal file
9
tests/snapshots/run_file__guide_bend_7tree.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_bend_7tree.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
λa (a 0 λb (b 0 λc (c 0 λd (d 1 7) λe (e 1 7)) λf (f 0 λg (g 1 7) λh (h 1 7))) λi (i 0 λj (j 0 λk (k 1 7) λl (l 1 7)) λm (m 0 λn (n 1 7) λo (o 1 7))))
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
λa λ* (a λb λ* (b λc λ* (c λ* λd (d 7) λ* λe (e 7)) λf λ* (f λ* λg (g 7) λ* λh (h 7))) λi λ* (i λj λ* (j λ* λk (k 7) λ* λl (l 7)) λm λ* (m λ* λn (n 7) λ* λo (o 7))))
|
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_bend_sequential.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
45
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
45
|
9
tests/snapshots/run_file__guide_bend_sum_tree.bend.snap
Normal file
9
tests/snapshots/run_file__guide_bend_sum_tree.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_bend_sum_tree.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
16760832
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
16760832
|
9
tests/snapshots/run_file__guide_bitonic_sort.bend.snap
Normal file
9
tests/snapshots/run_file__guide_bitonic_sort.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_bitonic_sort.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
523776
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
523776
|
9
tests/snapshots/run_file__guide_circle_area.bend.snap
Normal file
9
tests/snapshots/run_file__guide_circle_area.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_circle_area.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
314.000
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
314.000
|
9
tests/snapshots/run_file__guide_distance_4args.bend.snap
Normal file
9
tests/snapshots/run_file__guide_distance_4args.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_distance_4args.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
14.142
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
14.142
|
9
tests/snapshots/run_file__guide_distance_obj.bend.snap
Normal file
9
tests/snapshots/run_file__guide_distance_obj.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_distance_obj.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
14.142
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
14.142
|
9
tests/snapshots/run_file__guide_distance_tup.bend.snap
Normal file
9
tests/snapshots/run_file__guide_distance_tup.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_distance_tup.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
14.142
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
14.142
|
9
tests/snapshots/run_file__guide_enumerate.bend.snap
Normal file
9
tests/snapshots/run_file__guide_enumerate.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_enumerate.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
λa (a 0 λb (b 0 λc (c 1 (0, 1)) λd (d 1 (1, 2))) λe (e 0 λf (f 1 (2, 3)) λg (g 1 (3, 4))))
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
λa λ* (a λb λ* (b λ* λc (c (0, 1)) λ* λd (d (1, 2))) λe λ* (e λ* λf (f (2, 3)) λ* λg (g (3, 4))))
|
9
tests/snapshots/run_file__guide_if_age.bend.snap
Normal file
9
tests/snapshots/run_file__guide_if_age.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_if_age.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
"you're an adult"
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
"you're an adult"
|
9
tests/snapshots/run_file__guide_is_even_num.bend.snap
Normal file
9
tests/snapshots/run_file__guide_is_even_num.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_is_even_num.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
0
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
0
|
9
tests/snapshots/run_file__guide_is_even_str.bend.snap
Normal file
9
tests/snapshots/run_file__guide_is_even_str.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_is_even_str.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
"odd"
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
"odd"
|
9
tests/snapshots/run_file__guide_list_ctrs.bend.snap
Normal file
9
tests/snapshots/run_file__guide_list_ctrs.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_list_ctrs.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
[1, 2, 3]
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
[1, 2, 3]
|
9
tests/snapshots/run_file__guide_list_match.bend.snap
Normal file
9
tests/snapshots/run_file__guide_list_match.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_list_match.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
1
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
1
|
9
tests/snapshots/run_file__guide_list_sugar.bend.snap
Normal file
9
tests/snapshots/run_file__guide_list_sugar.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_list_sugar.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
[1, 2, 3]
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
[1, 2, 3]
|
9
tests/snapshots/run_file__guide_mul2_inline.bend.snap
Normal file
9
tests/snapshots/run_file__guide_mul2_inline.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_mul2_inline.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
14
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
14
|
9
tests/snapshots/run_file__guide_mul2_rec.bend.snap
Normal file
9
tests/snapshots/run_file__guide_mul2_rec.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_mul2_rec.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
14
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
14
|
9
tests/snapshots/run_file__guide_shader_dummy.bend.snap
Normal file
9
tests/snapshots/run_file__guide_shader_dummy.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_shader_dummy.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
(((((1, 1), (1, 1)), ((1, 1), (1, 1))), (((1, 1), (1, 1)), ((1, 1), (1, 1)))), ((((1, 1), (1, 1)), ((1, 1), (1, 1))), (((1, 1), (1, 1)), ((1, 1), (1, 1)))))
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
(((((1, 1), (1, 1)), ((1, 1), (1, 1))), (((1, 1), (1, 1)), ((1, 1), (1, 1)))), ((((1, 1), (1, 1)), ((1, 1), (1, 1))), (((1, 1), (1, 1)), ((1, 1), (1, 1)))))
|
9
tests/snapshots/run_file__guide_sum.bend.snap
Normal file
9
tests/snapshots/run_file__guide_sum.bend.snap
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
source: tests/golden_tests.rs
|
||||||
|
input_file: tests/golden_tests/run_file/guide_sum.bend
|
||||||
|
---
|
||||||
|
NumScott:
|
||||||
|
10
|
||||||
|
|
||||||
|
Scott:
|
||||||
|
10
|
Loading…
Reference in New Issue
Block a user