Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 337069f

Browse files
committed
[[ Tests ]] Wrap indentation tests in handlers
This patch wraps the indentation tests in handlers with a comment after the structure to test that the indentation after the structure is correct.
1 parent 2c7de7f commit 337069f

4 files changed

Lines changed: 155 additions & 89 deletions

File tree

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,57 @@
1-
if foo() then
2-
-- code
3-
else if bar() then
4-
-- code
5-
else
6-
-- code
7-
end if
1+
on foo
2+
if foo() then
3+
-- code
4+
else if bar() then
5+
-- code
6+
else
7+
-- code
8+
end if
9+
-- comment
10+
end foo
811

9-
if foo()
10-
then -- code
11-
else if bar() then
12-
-- code
13-
else
14-
-- code
15-
end if
12+
on foo
13+
if foo()
14+
then -- code
15+
else if bar() then
16+
-- code
17+
else
18+
-- code
19+
end if
20+
-- comment
21+
end foo
1622

17-
if foo()
18-
then code
19-
else if bar() then
20-
-- code
21-
else code
23+
on foo
24+
if foo()
25+
then code
26+
else if bar() then
27+
-- code
28+
else code
29+
-- comment
30+
end foo
2231

23-
if foo()
24-
then code
25-
else code
32+
on foo
33+
if foo()
34+
then code
35+
else code
36+
-- comment
37+
end foo
2638

27-
if foo() then code else code
39+
on foo
40+
if foo() then code else code
41+
-- comment
42+
end foo
2843

29-
if foo() then
30-
if bar() then code else code
31-
else
32-
code
33-
end if
44+
on foo
45+
if foo() then
46+
if bar() then code else code
47+
else
48+
code
49+
end if
50+
-- comment
51+
end foo
3452

35-
if foo()
36-
then code else code
53+
on foo
54+
if foo()
55+
then code else code
56+
-- comment
57+
end foo
Lines changed: 72 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,83 @@
1-
repeat forever
2-
-- code
3-
end repeat
1+
on foo
2+
repeat forever
3+
-- code
4+
end repeat
5+
-- comment
6+
end foo
47

5-
repeat while foo()
6-
-- code
7-
end repeat
8+
on foo
9+
repeat while foo()
10+
-- code
11+
end repeat
12+
-- comment
13+
end foo
814

9-
repeat until foo()
10-
-- code
11-
end repeat
15+
on foo
16+
repeat until foo()
17+
-- code
18+
end repeat
19+
-- comment
20+
end foo
1221

13-
repeat 3
14-
-- code
15-
end repeat
22+
on foo
23+
repeat 3
24+
-- code
25+
end repeat
26+
-- comment
27+
end foo
1628

17-
repeat for 3
18-
-- code
19-
end repeat
29+
on foo
30+
repeat for 3
31+
-- code
32+
end repeat
33+
-- comment
34+
end foo
2035

21-
repeat for 3 times
22-
-- code
23-
end repeat
36+
on foo
37+
repeat for 3 times
38+
-- code
39+
end repeat
40+
-- comment
41+
end foo
2442

25-
repeat 3 times
26-
-- code
27-
end repeat
43+
on foo
44+
repeat 3 times
45+
-- code
46+
end repeat
47+
-- comment
48+
end foo
2849

29-
repeat with X = 1 to 5
30-
-- code
31-
end repeat
50+
on foo
51+
repeat with X = 1 to 5
52+
-- code
53+
end repeat
54+
-- comment
55+
end foo
3256

33-
repeat with X = 1 to 5 step 2
34-
-- code
35-
end repeat
57+
on foo
58+
repeat with X = 1 to 5 step 2
59+
-- code
60+
end repeat
61+
-- comment
62+
end foo
3663

37-
repeat with X = 5 down to 1
38-
-- code
39-
end repeat
64+
on foo
65+
repeat with X = 5 down to 1
66+
-- code
67+
end repeat
68+
-- comment
69+
end foo
4070

41-
repeat with X = 5 down to 1 step 2
42-
-- code
43-
end repeat
71+
on foo
72+
repeat with X = 5 down to 1 step 2
73+
-- code
74+
end repeat
75+
-- comment
76+
end foo
4477

45-
repeat for each line tLine in tFoo
46-
-- code
47-
end repeat
78+
on foo
79+
repeat for each line tLine in tFoo
80+
-- code
81+
end repeat
82+
-- comment
83+
end foo
Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
switch tFoo
2-
case "foo"
3-
-- code
4-
break
5-
default
6-
-- code
7-
break
8-
end switch
1+
on foo
2+
switch tFoo
3+
case "foo"
4+
-- code
5+
break
6+
default
7+
-- code
8+
break
9+
end switch
10+
-- comment
11+
end foo
912

10-
switch
11-
case tFoo begins with "foo"
12-
-- code
13-
break
14-
default
15-
-- code
16-
break
17-
end switch
13+
on foo
14+
switch
15+
case tFoo begins with "foo"
16+
-- code
17+
break
18+
default
19+
-- code
20+
break
21+
end switch
22+
-- comment
23+
end foo
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
try
2-
-- code
3-
catch tError
4-
-- code
5-
finally
6-
-- code
7-
end try
1+
on foo
2+
try
3+
-- code
4+
catch tError
5+
-- code
6+
finally
7+
-- code
8+
end try
9+
-- comment
10+
end foo

0 commit comments

Comments
 (0)