@@ -219,6 +219,112 @@ class MergeActionTests: XCTestCase {
219
219
""" )
220
220
}
221
221
222
+ func testSupportsArchivesWithoutStaticHosting( ) throws {
223
+ let fileSystem = try TestFileSystem (
224
+ folders: [
225
+ Folder ( name: " Output.doccarchive " , content: [ ] ) ,
226
+ Self . makeArchive (
227
+ name: " First " ,
228
+ documentationPages: [
229
+ " First " ,
230
+ " First/SomeClass " ,
231
+ " First/SomeClass/someProperty " ,
232
+ " First/SomeClass/someFunction(:_) " ,
233
+ ] ,
234
+ tutorialPages: [
235
+ " First " ,
236
+ " First/SomeTutorial " ,
237
+ ] ,
238
+ images: [ " something.png " ] ,
239
+ videos: [ " something.mov " ] ,
240
+ downloads: [ " something.zip " ] ,
241
+ supportsStaticHosting: false
242
+ ) ,
243
+ Self . makeArchive (
244
+ name: " Second " ,
245
+ documentationPages: [
246
+ " Second " ,
247
+ " Second/SomeStruct " ,
248
+ " Second/SomeStruct/someProperty " ,
249
+ " Second/SomeStruct/someFunction(:_) " ,
250
+ ] ,
251
+ tutorialPages: [
252
+ " Second " ,
253
+ " Second/SomeTutorial " ,
254
+ ] ,
255
+ images: [ " something.png " ] ,
256
+ videos: [ " something.mov " ] ,
257
+ downloads: [ " something.zip " ] ,
258
+ supportsStaticHosting: false
259
+ ) ,
260
+ ]
261
+ )
262
+
263
+ let logStorage = LogHandle . LogStorage ( )
264
+ var action = MergeAction (
265
+ archives: [
266
+ URL ( fileURLWithPath: " /First.doccarchive " ) ,
267
+ URL ( fileURLWithPath: " /Second.doccarchive " ) ,
268
+ ] ,
269
+ outputURL: URL ( fileURLWithPath: " /Output.doccarchive " ) ,
270
+ fileManager: fileSystem
271
+ )
272
+
273
+ _ = try action. perform ( logHandle: . memory( logStorage) )
274
+ XCTAssertEqual ( logStorage. text, " " , " The action didn't log anything " )
275
+
276
+ // The combined archive as the data and assets from the input archives but only one set of archive template files
277
+ XCTAssertEqual ( fileSystem. dump ( subHierarchyFrom: " /Output.doccarchive " ) , """
278
+ Output.doccarchive/
279
+ ├─ css/
280
+ │ ╰─ something.css
281
+ ├─ data/
282
+ │ ├─ documentation/
283
+ │ │ ├─ first.json
284
+ │ │ ├─ first/
285
+ │ │ │ ├─ someclass.json
286
+ │ │ │ ╰─ someclass/
287
+ │ │ │ ├─ somefunction(:_).json
288
+ │ │ │ ╰─ someproperty.json
289
+ │ │ ├─ second.json
290
+ │ │ ╰─ second/
291
+ │ │ ├─ somestruct.json
292
+ │ │ ╰─ somestruct/
293
+ │ │ ├─ somefunction(:_).json
294
+ │ │ ╰─ someproperty.json
295
+ │ ╰─ tutorials/
296
+ │ ├─ first.json
297
+ │ ├─ first/
298
+ │ │ ╰─ sometutorial.json
299
+ │ ├─ second.json
300
+ │ ╰─ second/
301
+ │ ╰─ sometutorial.json
302
+ ├─ downloads/
303
+ │ ├─ com.example.first/
304
+ │ │ ╰─ something.zip
305
+ │ ╰─ com.example.second/
306
+ │ ╰─ something.zip
307
+ ├─ favicon.svg
308
+ ├─ images/
309
+ │ ├─ com.example.first/
310
+ │ │ ╰─ something.png
311
+ │ ╰─ com.example.second/
312
+ │ ╰─ something.png
313
+ ├─ img/
314
+ │ ╰─ something.svg
315
+ ├─ index/
316
+ │ ╰─ index.json
317
+ ├─ js/
318
+ │ ╰─ something.js
319
+ ├─ metadata.json
320
+ ╰─ videos/
321
+ ├─ com.example.first/
322
+ │ ╰─ something.mov
323
+ ╰─ com.example.second/
324
+ ╰─ something.mov
325
+ """ )
326
+ }
327
+
222
328
func testErrorWhenArchivesContainOverlappingData( ) throws {
223
329
let fileSystem = try TestFileSystem (
224
330
folders: [
0 commit comments