Skip to content

Commit 5e4b526

Browse files
committed
update and add new regression tests
1 parent 5e1ca88 commit 5e4b526

File tree

6 files changed

+456
-79
lines changed

6 files changed

+456
-79
lines changed

tests/robotcode/language_server/robotframework/parts/data/tests/templates.robot

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Settings ***
22
Test Template suite template keyword
33

4+
Test Template check that 1 plus ${b} is ${expected}
45

56
*** Test Cases ***
67
first
@@ -20,6 +21,30 @@ third
2021
[Template] NONE
2122
Log hello
2223

24+
templated
25+
[Template] templated kw
26+
1 2 3
27+
3 4 7
28+
29+
templated with embedded
30+
2 3
31+
3 4 7
32+
33+
templated with embedded2
34+
[Template] check that 1 plus ${b} is ${expected}
35+
2 3
36+
3 4 7
37+
38+
templated with embedded1
39+
[Template] check that 1 plus ${b} is ${expected}
40+
2 3
41+
4 7
42+
43+
templated with embedded not defined
44+
[Template] verify that ${a} plus ${b} is ${expected}
45+
1 2 3
46+
3 4 7
47+
2348
*** Keywords ***
2449
suite template keyword
2550
[Arguments] ${a} ${b} ${c}
@@ -33,4 +58,22 @@ template keyword
3358
Log Template
3459
Log ${a}
3560
Log ${b}
36-
Log ${c}
61+
Log ${c}
62+
63+
do something
64+
Log hello from do something
65+
[Teardown] Run Keywords Log ${KEYWORD STATUS} AND Log ${KEYWORD MESSAGE}
66+
67+
a keyword with loop
68+
[Arguments] ${aaa}
69+
70+
FOR ${i} IN RANGE 100
71+
Log ${i} ${aaa}
72+
END
73+
74+
check that ${a} plus ${b:[a-c]+} is ${expected}
75+
log ${a} ${b} ${expected}
76+
77+
templated kw
78+
[Arguments] ${a} ${b} ${expected}
79+
log ${a} ${b} ${expected}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
*** Settings ***
2+
Test Template Login with invalid credentials should fail
3+
4+
*** Variables ***
5+
${VALID USER} valid
6+
${VALID PASSWORD} pw
7+
@{ITEMS} 1 2 3 4 5 6
8+
9+
*** Test Cases *** USERNAME PASSWORD
10+
Invalid User Name invalid ${VALID PASSWORD}
11+
Invalid Password ${VALID USER} invalid
12+
Invalid User Name and Password invalid invalid
13+
Empty User Name ${EMPTY} ${VALID PASSWORD}
14+
Empty Password ${VALID USER} ${EMPTY}
15+
Empty User Name and Password ${EMPTY} ${EMPTY}
16+
17+
*** Test Cases ***
18+
Template with FOR loop
19+
[Template] Example keyword
20+
FOR ${item} IN @{ITEMS}
21+
${item} 2nd arg
22+
END
23+
FOR ${index} IN RANGE 42
24+
1st arg ${index}
25+
END
26+
27+
Template with FOR and IF
28+
[Template] Example keyword
29+
FOR ${item} IN @{ITEMS}
30+
IF ${item} < 5
31+
${item} 2nd arg
32+
ELSE
33+
${item} 3nd arg
34+
END
35+
END
36+
37+
*** Keywords ***
38+
Login with invalid credentials should fail
39+
[Arguments] ${username} ${password}
40+
Log ${username} ${password}
41+
42+
Example keyword
43+
[Arguments] @{items}
44+
Log ${items}

tests/robotcode/language_server/robotframework/parts/data/tests/variables.robot

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,20 @@ tc
128128
Log ${${VALUE}_DATA1}
129129
Log ${${VALUE}_1}
130130

131+
templated
132+
[Template] templated kw
133+
1 2 3
134+
3 4 7
135+
136+
templated with embedded
137+
[Template] check that ${a} plus ${b} is ${expected}
138+
1 2 3
139+
3 4 7
140+
141+
templated with embedded not defined
142+
[Template] verify that ${a} plus ${b} is ${expected}
143+
1 2 3
144+
3 4 7
131145

132146
*** Keywords ***
133147
do something
@@ -141,3 +155,9 @@ a keyword with loop
141155
Log ${i} ${aaa}
142156
END
143157

158+
check that ${a} plus ${b} is ${expected}
159+
log ${a} ${b} ${expected}
160+
161+
templated kw
162+
[Arguments] ${a} ${b} ${expected}
163+
log ${a} ${b} ${expected}

tests/robotcode/language_server/robotframework/parts/test_references/test_references_robot_034_004_simple_keyword_call_.yml

Lines changed: 116 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,83 +1114,155 @@ result:
11141114
range:
11151115
end:
11161116
character: 7
1117-
line: 20
1117+
line: 21
11181118
start:
11191119
character: 4
1120-
line: 20
1120+
line: 21
11211121
uri: tests/templates.robot
11221122
- !Location
11231123
range:
11241124
end:
11251125
character: 7
1126-
line: 25
1126+
line: 50
11271127
start:
11281128
character: 4
1129-
line: 25
1129+
line: 50
11301130
uri: tests/templates.robot
11311131
- !Location
11321132
range:
11331133
end:
11341134
character: 7
1135-
line: 26
1135+
line: 51
11361136
start:
11371137
character: 4
1138-
line: 26
1138+
line: 51
11391139
uri: tests/templates.robot
11401140
- !Location
11411141
range:
11421142
end:
11431143
character: 7
1144-
line: 27
1144+
line: 52
11451145
start:
11461146
character: 4
1147-
line: 27
1147+
line: 52
11481148
uri: tests/templates.robot
11491149
- !Location
11501150
range:
11511151
end:
11521152
character: 7
1153-
line: 28
1153+
line: 53
11541154
start:
11551155
character: 4
1156-
line: 28
1156+
line: 53
11571157
uri: tests/templates.robot
11581158
- !Location
11591159
range:
11601160
end:
11611161
character: 7
1162-
line: 32
1162+
line: 57
11631163
start:
11641164
character: 4
1165-
line: 32
1165+
line: 57
11661166
uri: tests/templates.robot
11671167
- !Location
11681168
range:
11691169
end:
11701170
character: 7
1171-
line: 33
1171+
line: 58
11721172
start:
11731173
character: 4
1174-
line: 33
1174+
line: 58
11751175
uri: tests/templates.robot
11761176
- !Location
11771177
range:
11781178
end:
11791179
character: 7
1180-
line: 34
1180+
line: 59
11811181
start:
11821182
character: 4
1183-
line: 34
1183+
line: 59
11841184
uri: tests/templates.robot
11851185
- !Location
11861186
range:
11871187
end:
11881188
character: 7
1189-
line: 35
1189+
line: 60
11901190
start:
11911191
character: 4
1192-
line: 35
1192+
line: 60
1193+
uri: tests/templates.robot
1194+
- !Location
1195+
range:
1196+
end:
1197+
character: 7
1198+
line: 63
1199+
start:
1200+
character: 4
1201+
line: 63
1202+
uri: tests/templates.robot
1203+
- !Location
1204+
range:
1205+
end:
1206+
character: 37
1207+
line: 64
1208+
start:
1209+
character: 34
1210+
line: 64
1211+
uri: tests/templates.robot
1212+
- !Location
1213+
range:
1214+
end:
1215+
character: 72
1216+
line: 64
1217+
start:
1218+
character: 69
1219+
line: 64
1220+
uri: tests/templates.robot
1221+
- !Location
1222+
range:
1223+
end:
1224+
character: 11
1225+
line: 70
1226+
start:
1227+
character: 8
1228+
line: 70
1229+
uri: tests/templates.robot
1230+
- !Location
1231+
range:
1232+
end:
1233+
character: 7
1234+
line: 74
1235+
start:
1236+
character: 4
1237+
line: 74
11931238
uri: tests/templates.robot
1239+
- !Location
1240+
range:
1241+
end:
1242+
character: 7
1243+
line: 78
1244+
start:
1245+
character: 4
1246+
line: 78
1247+
uri: tests/templates.robot
1248+
- !Location
1249+
range:
1250+
end:
1251+
character: 7
1252+
line: 39
1253+
start:
1254+
character: 4
1255+
line: 39
1256+
uri: tests/templates2.robot
1257+
- !Location
1258+
range:
1259+
end:
1260+
character: 7
1261+
line: 43
1262+
start:
1263+
character: 4
1264+
line: 43
1265+
uri: tests/templates2.robot
11941266
- !Location
11951267
range:
11961268
end:
@@ -1627,37 +1699,55 @@ result:
16271699
range:
16281700
end:
16291701
character: 7
1630-
line: 133
1702+
line: 147
16311703
start:
16321704
character: 4
1633-
line: 133
1705+
line: 147
16341706
uri: tests/variables.robot
16351707
- !Location
16361708
range:
16371709
end:
16381710
character: 37
1639-
line: 134
1711+
line: 148
16401712
start:
16411713
character: 34
1642-
line: 134
1714+
line: 148
16431715
uri: tests/variables.robot
16441716
- !Location
16451717
range:
16461718
end:
16471719
character: 72
1648-
line: 134
1720+
line: 148
16491721
start:
16501722
character: 69
1651-
line: 134
1723+
line: 148
16521724
uri: tests/variables.robot
16531725
- !Location
16541726
range:
16551727
end:
16561728
character: 11
1657-
line: 140
1729+
line: 154
16581730
start:
16591731
character: 8
1660-
line: 140
1732+
line: 154
1733+
uri: tests/variables.robot
1734+
- !Location
1735+
range:
1736+
end:
1737+
character: 7
1738+
line: 158
1739+
start:
1740+
character: 4
1741+
line: 158
1742+
uri: tests/variables.robot
1743+
- !Location
1744+
range:
1745+
end:
1746+
character: 7
1747+
line: 162
1748+
start:
1749+
character: 4
1750+
line: 162
16611751
uri: tests/variables.robot
16621752
- !Location
16631753
range:

0 commit comments

Comments
 (0)