Skip to content

Commit a76082a

Browse files
committed
check_library_structure/check_sketch_structure: Add unit tests for all output
1 parent aea9ff8 commit a76082a

File tree

1 file changed

+76
-12
lines changed

1 file changed

+76
-12
lines changed

tests/check_library_structure.bats

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
2525
echo "Exit status: $status | Expected: $expectedExitStatus"
2626
[ "$status" -eq $expectedExitStatus ]
2727
[ "${#lines[@]}" -eq 1 ]
28+
outputRegex="^WARNING: \./check_library_structure/ValidLibraryOnePointZero is missing a library\.properties file. While not required, it's recommended to add this file to provide helpful metadata\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#library-metadata"
29+
[[ "${lines[0]}" =~ $outputRegex ]]
2830
}
2931

3032
@test "check_library_structure \"./check_library_structure/ValidLibraryOnePointFive\"" {
@@ -49,6 +51,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
4951
echo "Exit status: $status | Expected: $expectedExitStatus"
5052
[ "$status" -eq $expectedExitStatus ]
5153
[ "${#lines[@]}" -eq 1 ]
54+
outputRegex="^WARNING: \./check_library_structure/InvalidLibraryBelowDepth is missing a library\.properties file\. While not required, it's recommended to add this file to provide helpful metadata\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#library-metadata"
55+
[[ "${lines[0]}" =~ $outputRegex ]]
5256
}
5357

5458
@test "check_library_structure \"./check_library_structure/DoesntExist\"" {
@@ -57,6 +61,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
5761
echo "Exit status: $status | Expected: $expectedExitStatus"
5862
[ "$status" -eq $expectedExitStatus ]
5963
[ "${#lines[@]}" -eq 1 ]
64+
outputRegex="^ERROR: Specified folder: \./check_library_structure/DoesntExist doesn't exist\."
65+
[[ "${lines[0]}" =~ $outputRegex ]]
6066
}
6167

6268
@test "check_library_structure \"./check_library_structure/IncorrectSrcFolderCase\"" {
@@ -65,6 +71,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
6571
echo "Exit status: $status | Expected: $expectedExitStatus"
6672
[ "$status" -eq $expectedExitStatus ]
6773
[ "${#lines[@]}" -eq 1 ]
74+
outputRegex='^ERROR: \./check_library_structure/IncorrectSrcFolderCase is a 1\.5 format library with incorrect case in src subfolder name, which causes library to not be recognized on a filename case-sensitive OS such as Linux\.'
75+
[[ "${lines[0]}" =~ $outputRegex ]]
6876
}
6977

7078
@test "check_library_structure \"./check_library_structure/MultipleInvalidLibraries\" 1" {
@@ -73,6 +81,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
7381
echo "Exit status: $status | Expected: $expectedExitStatus"
7482
[ "$status" -eq $expectedExitStatus ]
7583
[ "${#lines[@]}" -eq 1 ]
84+
outputRegex='^ERROR: \./check_library_structure/MultipleInvalidLibraries/IncorrectSrcFolderCase is a 1\.5 format library with incorrect case in src subfolder name, which causes library to not be recognized on a filename case-sensitive OS such as Linux\.'
85+
[[ "${lines[0]}" =~ $outputRegex ]]
7686
}
7787

7888
@test "check_library_structure \"./check_library_structure/NotLibrary\"" {
@@ -81,6 +91,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
8191
echo "Exit status: $status | Expected: $expectedExitStatus"
8292
[ "$status" -eq $expectedExitStatus ]
8393
[ "${#lines[@]}" -eq 1 ]
94+
outputRegex='^ERROR: No valid library found in \./check_library_structure/NotLibrary'
95+
[[ "${lines[0]}" =~ $outputRegex ]]
8496
}
8597

8698
@test "check_library_structure \"./check_library_structure/1FolderStartsWithNumber\"" {
@@ -89,8 +101,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
89101
echo "Exit status: $status | Expected: $expectedExitStatus"
90102
[ "$status" -eq $expectedExitStatus ]
91103
[ "${#lines[@]}" -eq 1 ]
92-
warningRegex='^WARNING: Folder name \(.*\) beginning with a number'
93-
[[ "${lines[0]}" =~ $warningRegex ]]
104+
outputRegex='^WARNING: Discouraged folder name: 1FolderStartsWithNumber\. Folder name beginning with a number is only supported by Arduino IDE 1\.8\.4 and newer\.'
105+
[[ "${lines[0]}" =~ $outputRegex ]]
94106
}
95107

96108
@test "check_library_structure \"./check_library_structure/-FolderStartsWithInvalidCharacter\"" {
@@ -99,6 +111,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
99111
echo "Exit status: $status | Expected: $expectedExitStatus"
100112
[ "$status" -eq $expectedExitStatus ]
101113
[ "${#lines[@]}" -eq 1 ]
114+
outputRegex='^ERROR: Invalid folder name: -FolderStartsWithInvalidCharacter\. Folder name beginning with a - or \. is not allowed\.'
115+
[[ "${lines[0]}" =~ $outputRegex ]]
102116
}
103117

104118
@test "check_library_structure \"./check_library_structure/Invalid CharactersInFolder\"" {
@@ -107,6 +121,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
107121
echo "Exit status: $status | Expected: $expectedExitStatus"
108122
[ "$status" -eq $expectedExitStatus ]
109123
[ "${#lines[@]}" -eq 1 ]
124+
outputRegex='^ERROR: Invalid folder name: Invalid CharactersInFolder\. Only letters, numbers, dots, dashes, and underscores are allowed\.'
125+
[[ "${lines[0]}" =~ $outputRegex ]]
110126
}
111127

112128
@test "check_library_structure \"./check_library_structure/FolderNameTooLongasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd\"" {
@@ -115,6 +131,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
115131
echo "Exit status: $status | Expected: $expectedExitStatus"
116132
[ "$status" -eq $expectedExitStatus ]
117133
[ "${#lines[@]}" -eq 1 ]
134+
outputRegex='^ERROR: Folder name FolderNameTooLongasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasd exceeds the maximum of 63 characters\.'
135+
[[ "${lines[0]}" =~ $outputRegex ]]
118136
}
119137

120138
@test "check_library_structure \"./check_library_structure/SpuriousDotFolder\"" {
@@ -123,8 +141,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
123141
echo "Exit status: $status | Expected: $expectedExitStatus"
124142
[ "$status" -eq $expectedExitStatus ]
125143
[ "${#lines[@]}" -eq 1 ]
126-
errorRegex='^ERROR: \./check_library_structure/SpuriousDotFolder/\.asdf causes the Arduino IDE to display a spurious folder warning\.'
127-
[[ "${lines[0]}" =~ $warningRegex ]]
144+
outputRegex='^ERROR: \./check_library_structure/SpuriousDotFolder/\.asdf causes the Arduino IDE to display a spurious folder warning\.'
145+
[[ "${lines[0]}" =~ $outputRegex ]]
128146
}
129147

130148
@test "check_library_structure \"./check_library_structure/IncorrectExtrasFolder\"" {
@@ -133,6 +151,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
133151
echo "Exit status: $status | Expected: $expectedExitStatus"
134152
[ "$status" -eq $expectedExitStatus ]
135153
[ "${#lines[@]}" -eq 1 ]
154+
outputRegex='^ERROR: \./check_library_structure/IncorrectExtrasFolder has incorrectly spelled extras folder name\. It should be exactly extras\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#extra-documentation'
155+
[[ "${lines[0]}" =~ $outputRegex ]]
136156
}
137157

138158
@test "check_library_structure \"./check_library_structure/IncorrectExamplesFolder\"" {
@@ -141,6 +161,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
141161
echo "Exit status: $status | Expected: $expectedExitStatus"
142162
[ "$status" -eq $expectedExitStatus ]
143163
[ "${#lines[@]}" -eq 1 ]
164+
outputRegex='^ERROR: \./check_library_structure/IncorrectExamplesFolder has incorrect examples folder name. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#library-examples'
165+
[[ "${lines[0]}" =~ $outputRegex ]]
144166
}
145167

146168
@test "check_library_structure \"./check_library_structure/SrcAndUtiltyFolders\"" {
@@ -149,6 +171,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
149171
echo "Exit status: $status | Expected: $expectedExitStatus"
150172
[ "$status" -eq $expectedExitStatus ]
151173
[ "${#lines[@]}" -eq 1 ]
174+
outputRegex='^ERROR: \./check_library_structure/SrcAndUtiltyFolders is a 1\.5 format library with src and utility folders in library root\. The utility folder should be moved under the src folder\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#source-code'
175+
[[ "${lines[0]}" =~ $outputRegex ]]
152176
}
153177

154178
@test "check_library_structure \"./check_library_structure/MissingLibraryProperties\"" {
@@ -157,8 +181,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
157181
echo "Exit status: $status | Expected: $expectedExitStatus"
158182
[ "$status" -eq $expectedExitStatus ]
159183
[ "${#lines[@]}" -eq 1 ]
160-
missingLibraryPropertiesWarningRegex='^WARNING: \./check_library_structure/MissingLibraryProperties is missing a library\.properties file\.'
161-
[[ "${lines[0]}" =~ $missingLibraryPropertiesWarningRegex ]]
184+
outputRegex="^WARNING: \./check_library_structure/MissingLibraryProperties is missing a library\.properties file. While not required, it's recommended to add this file to provide helpful metadata\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#library-metadata"
185+
[[ "${lines[0]}" =~ $outputRegex ]]
162186
}
163187

164188
@test "check_library_structure \"./check_library_structure/StrayLibraryProperties\"" {
@@ -167,6 +191,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
167191
echo "Exit status: $status | Expected: $expectedExitStatus"
168192
[ "$status" -eq $expectedExitStatus ]
169193
[ "${#lines[@]}" -eq 1 ]
194+
outputRegex='^ERROR: \./check_library_structure/StrayLibraryProperties/src/library\.properties is a stray file\. library\.properties should be located in the library root folder\.'
195+
[[ "${lines[0]}" =~ $outputRegex ]]
170196
}
171197

172198
@test "check_library_structure \"./check_library_structure/MissingKeywordsTxt\"" {
@@ -175,8 +201,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
175201
echo "Exit status: $status | Expected: $expectedExitStatus"
176202
[ "$status" -eq $expectedExitStatus ]
177203
[ "${#lines[@]}" -eq 1 ]
178-
missingKeywordsTxtWarningRegex='^WARNING: \./check_library_structure/MissingKeywordsTxt is missing a keywords\.txt file\.'
179-
[[ "${lines[0]}" =~ $missingKeywordsTxtWarningRegex ]]
204+
outputRegex="^WARNING: \./check_library_structure/MissingKeywordsTxt is missing a keywords\.txt file\. While not required, it's recommended to add this file to provide keyword highlighting in the Arduino IDE\. See: https://github\.com/arduino/Arduino/wiki/Arduino-IDE-1\.5:-Library-specification#keywords"
205+
[[ "${lines[0]}" =~ $outputRegex ]]
180206
}
181207

182208
@test "check_library_structure \"./check_library_structure/StrayKeywordsTxt\"" {
@@ -185,6 +211,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
185211
echo "Exit status: $status | Expected: $expectedExitStatus"
186212
[ "$status" -eq $expectedExitStatus ]
187213
[ "${#lines[@]}" -eq 1 ]
214+
outputRegex='^'
215+
[[ "${lines[0]}" =~ $outputRegex ]]
188216
}
189217

190218
@test "check_library_structure \"./check_library_structure/SketchOutsideExamples\"" {
@@ -193,6 +221,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
193221
echo "Exit status: $status | Expected: $expectedExitStatus"
194222
[ "$status" -eq $expectedExitStatus ]
195223
[ "${#lines[@]}" -eq 1 ]
224+
outputRegex='^'
225+
[[ "${lines[0]}" =~ $outputRegex ]]
196226
}
197227

198228
# check_sketch_structure
@@ -203,6 +233,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
203233
echo "Exit status: $status | Expected: $expectedExitStatus"
204234
[ "$status" -eq $expectedExitStatus ]
205235
[ "${#lines[@]}" -eq 1 ]
236+
outputRegex='^'
237+
[[ "${lines[0]}" =~ $outputRegex ]]
206238
}
207239

208240
@test "check_sketch_structure \"./check_library_structure/PdeSketchExtension\"" {
@@ -211,8 +243,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
211243
echo "Exit status: $status | Expected: $expectedExitStatus"
212244
[ "$status" -eq $expectedExitStatus ]
213245
[ "${#lines[@]}" -eq 1 ]
214-
pdeWarningRegex='^WARNING: File .* uses the \.pde extension'
215-
[[ "${lines[0]}" =~ $pdeWarningRegex ]]
246+
outputRegex='^'
247+
[[ "${lines[0]}" =~ $outputRegex ]]
216248
}
217249

218250
@test "check_sketch_structure \"./check_library_structure/IncorrectSketchExtensionCase\"" {
@@ -221,6 +253,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
221253
echo "Exit status: $status | Expected: $expectedExitStatus"
222254
[ "$status" -eq $expectedExitStatus ]
223255
[ "${#lines[@]}" -eq 1 ]
256+
outputRegex='^'
257+
[[ "${lines[0]}" =~ $outputRegex ]]
224258
}
225259

226260
@test "check_library_structure \"./check_library_structure/IncorrectSketchExtensionCase\"" {
@@ -229,6 +263,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
229263
echo "Exit status: $status | Expected: $expectedExitStatus"
230264
[ "$status" -eq $expectedExitStatus ]
231265
[ "${#lines[@]}" -eq 1 ]
266+
outputRegex='^'
267+
[[ "${lines[0]}" =~ $outputRegex ]]
232268
}
233269

234270
@test "check_sketch_structure \"./check_library_structure/SketchFolderStartsWithNumber\"" {
@@ -237,8 +273,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
237273
echo "Exit status: $status | Expected: $expectedExitStatus"
238274
[ "$status" -eq $expectedExitStatus ]
239275
[ "${#lines[@]}" -eq 1 ]
240-
warningRegex='^WARNING: Folder name \(.*\) beginning with a number'
241-
[[ "${lines[0]}" =~ $warningRegex ]]
276+
outputRegex='^'
277+
[[ "${lines[0]}" =~ $outputRegex ]]
242278
}
243279

244280
@test "check_sketch_structure \"./check_library_structure/InvalidCharactersAtStartOfSketchFolder\"" {
@@ -247,6 +283,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
247283
echo "Exit status: $status | Expected: $expectedExitStatus"
248284
[ "$status" -eq $expectedExitStatus ]
249285
[ "${#lines[@]}" -eq 1 ]
286+
outputRegex='^'
287+
[[ "${lines[0]}" =~ $outputRegex ]]
250288
}
251289

252290
@test "check_library_structure \"./check_library_structure/InvalidCharactersAtStartOfSketchFolder\"" {
@@ -255,6 +293,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
255293
echo "Exit status: $status | Expected: $expectedExitStatus"
256294
[ "$status" -eq $expectedExitStatus ]
257295
[ "${#lines[@]}" -eq 1 ]
296+
outputRegex='^'
297+
[[ "${lines[0]}" =~ $outputRegex ]]
258298
}
259299

260300
@test "check_sketch_structure \"./check_library_structure/InvalidCharactersInSketchFolder\"" {
@@ -263,6 +303,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
263303
echo "Exit status: $status | Expected: $expectedExitStatus"
264304
[ "$status" -eq $expectedExitStatus ]
265305
[ "${#lines[@]}" -eq 1 ]
306+
outputRegex='^'
307+
[[ "${lines[0]}" =~ $outputRegex ]]
266308
}
267309

268310
@test "check_library_structure \"./check_library_structure/InvalidCharactersInSketchFolder\"" {
@@ -271,6 +313,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
271313
echo "Exit status: $status | Expected: $expectedExitStatus"
272314
[ "$status" -eq $expectedExitStatus ]
273315
[ "${#lines[@]}" -eq 1 ]
316+
outputRegex='^ERROR: Invalid folder name: example 1\. Only letters, numbers, dots, dashes, and underscores are allowed\.'
317+
[[ "${lines[0]}" =~ $outputRegex ]]
274318
}
275319

276320
@test "check_sketch_structure \"./check_library_structure/SketchFolderNameTooLong\"" {
@@ -279,6 +323,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
279323
echo "Exit status: $status | Expected: $expectedExitStatus"
280324
[ "$status" -eq $expectedExitStatus ]
281325
[ "${#lines[@]}" -eq 1 ]
326+
outputRegex='^ERROR: Folder name asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf exceeds the maximum of 63 characters\.'
327+
[[ "${lines[0]}" =~ $outputRegex ]]
282328
}
283329

284330
@test "check_library_structure \"./check_library_structure/SketchFolderNameTooLong\"" {
@@ -287,6 +333,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
287333
echo "Exit status: $status | Expected: $expectedExitStatus"
288334
[ "$status" -eq $expectedExitStatus ]
289335
[ "${#lines[@]}" -eq 1 ]
336+
outputRegex='^ERROR: Folder name asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf exceeds the maximum of 63 characters\.'
337+
[[ "${lines[0]}" =~ $outputRegex ]]
290338
}
291339

292340
@test "check_sketch_structure \"./check_library_structure/SketchFolderNameTooLongExtras\"" {
@@ -295,6 +343,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
295343
echo "Exit status: $status | Expected: $expectedExitStatus"
296344
[ "$status" -eq $expectedExitStatus ]
297345
[ "${#lines[@]}" -eq 1 ]
346+
outputRegex='^ERROR: Folder name asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf exceeds the maximum of 63 characters\.'
347+
[[ "${lines[0]}" =~ $outputRegex ]]
298348
}
299349

300350
@test "check_library_structure \"./check_library_structure/SketchFolderNameTooLongExtras\"" {
@@ -303,6 +353,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
303353
echo "Exit status: $status | Expected: $expectedExitStatus"
304354
[ "$status" -eq $expectedExitStatus ]
305355
[ "${#lines[@]}" -eq 1 ]
356+
outputRegex='^ERROR: Folder name asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf exceeds the maximum of 63 characters\.'
357+
[[ "${lines[0]}" =~ $outputRegex ]]
306358
}
307359

308360
@test "check_sketch_structure \"./check_library_structure/SketchFolderNameMismatch\"" {
@@ -311,6 +363,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
311363
echo "Exit status: $status | Expected: $expectedExitStatus"
312364
[ "$status" -eq $expectedExitStatus ]
313365
[ "${#lines[@]}" -eq 1 ]
366+
outputRegex='^ERROR: Sketch folder name \./check_library_structure/SketchFolderNameMismatch/examples/example1 does not match the sketch filename\.'
367+
[[ "${lines[0]}" =~ $outputRegex ]]
314368
}
315369

316370
@test "check_library_structure \"./check_library_structure/SketchFolderNameMismatch\"" {
@@ -319,6 +373,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
319373
echo "Exit status: $status | Expected: $expectedExitStatus"
320374
[ "$status" -eq $expectedExitStatus ]
321375
[ "${#lines[@]}" -eq 1 ]
376+
outputRegex='^ERROR: Sketch folder name \./check_library_structure/SketchFolderNameMismatch/examples/example1 does not match the sketch filename\.'
377+
[[ "${lines[0]}" =~ $outputRegex ]]
322378
}
323379

324380
@test "check_sketch_structure \"./check_library_structure/MultipleSketchesInSameFolderUnix\"" {
@@ -327,6 +383,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
327383
echo "Exit status: $status | Expected: $expectedExitStatus"
328384
[ "$status" -eq $expectedExitStatus ]
329385
[ "${#lines[@]}" -eq 1 ]
386+
outputRegex='^ERROR: Multiple sketches found in the same folder \(\./check_library_structure/MultipleSketchesInSameFolderUnix/examples/example1\)\.'
387+
[[ "${lines[0]}" =~ $outputRegex ]]
330388
}
331389

332390
@test "check_library_structure \"./check_library_structure/MultipleSketchesInSameFolderUnix\"" {
@@ -335,6 +393,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
335393
echo "Exit status: $status | Expected: $expectedExitStatus"
336394
[ "$status" -eq $expectedExitStatus ]
337395
[ "${#lines[@]}" -eq 1 ]
396+
outputRegex='^ERROR: Multiple sketches found in the same folder \(\./check_library_structure/MultipleSketchesInSameFolderUnix/examples/example1\)\.'
397+
[[ "${lines[0]}" =~ $outputRegex ]]
338398
}
339399

340400
@test "check_sketch_structure \"./check_library_structure/MultipleSketchesInSameFolderMac\"" {
@@ -343,6 +403,8 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
343403
echo "Exit status: $status | Expected: $expectedExitStatus"
344404
[ "$status" -eq $expectedExitStatus ]
345405
[ "${#lines[@]}" -eq 1 ]
406+
outputRegex='^ERROR: Multiple sketches found in the same folder \(\./check_library_structure/MultipleSketchesInSameFolderMac/examples/example1\)\.'
407+
[[ "${lines[0]}" =~ $outputRegex ]]
346408
}
347409

348410
@test "check_library_structure \"./check_library_structure/MultipleSketchesInSameFolderMac\"" {
@@ -351,4 +413,6 @@ TESTS_BATS_APPLICATION_FOLDER="$APPLICATION_FOLDER"
351413
echo "Exit status: $status | Expected: $expectedExitStatus"
352414
[ "$status" -eq $expectedExitStatus ]
353415
[ "${#lines[@]}" -eq 1 ]
416+
outputRegex='^ERROR: Multiple sketches found in the same folder \(\./check_library_structure/MultipleSketchesInSameFolderMac/examples/example1\)\.'
417+
[[ "${lines[0]}" =~ $outputRegex ]]
354418
}

0 commit comments

Comments
 (0)