-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestprinttree.tiny
88 lines (82 loc) · 1.35 KB
/
testprinttree.tiny
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#################################################################
#
# Test printing out a tree of values
#
#################################################################
import utils
testStr1 = '{
a: 1
b: {
c: {
x: 10
y: 15
}
d: 3
}
e: {
f: [
1,
[
2,
3,
[
4,
5
],
6
],
7,
8,
9,
{
Q: 1
R: 2
S: 3
T: 4
},
27
]
}
g: 5
}
'
testStr2 = '{
a: 1
b: 2
c: [
1,
2,
3,
4,
5
]
d: {
x: [
1,
{
a: 1
b: 2
},
3
]
y: 4
z: [
1,
{
p: 1
q: 2
r: 3
s: 3.14
},
3,
4
]
}
}
'
alert("Trying test string 1")
result1 = testStr1 |> eval |> utils.PrintTree == testStr1
alert("result 1 was $result1")
alert("Trying test string 2")
result2 = testStr2 |> eval |> utils.PrintTree == testStr2
alert("result 2 was $result2")