@@ -913,4 +913,38 @@ final class EnumeratorTests: XCTestCase {
913913 XCTAssertEqual ( ( error as NSError ? ) ? . code, NSFeatureUnsupportedError)
914914 }
915915 }
916+
917+ func testRemoteLockFilesNotEnumerated( ) async throws {
918+ let db = Self . dbManager. ncDatabase ( ) // Strong ref for in memory test db
919+ debugPrint ( db) // Avoid build-time warning about unused variable, ensure compiler won't free
920+ let remoteInterface = MockRemoteInterface ( rootItem: rootItem, rootTrashItem: rootTrashItem)
921+
922+ rootItem. children = [ remoteFolder]
923+ remoteFolder. parent = rootItem
924+
925+ let remoteLockFileItem = MockRemoteItem (
926+ identifier: " lock-file " ,
927+ name: " ~$lock-file.docx " ,
928+ remotePath: Self . account. davFilesUrl + " / " + remoteFolder. name + " /~$lock-file.docx " ,
929+ account: Self . account. ncKitAccount,
930+ username: Self . account. username,
931+ userId: Self . account. id,
932+ serverUrl: Self . account. serverUrl
933+ )
934+ rootItem. children. append ( remoteLockFileItem)
935+ remoteLockFileItem. parent = rootItem
936+
937+ let enumerator = Enumerator (
938+ enumeratedItemIdentifier: . rootContainer,
939+ account: Self . account,
940+ remoteInterface: remoteInterface,
941+ dbManager: Self . dbManager
942+ )
943+ let observer = MockEnumerationObserver ( enumerator: enumerator)
944+ try await observer. enumerateItems ( )
945+ XCTAssertEqual ( observer. items. count, 1 )
946+ XCTAssertFalse (
947+ observer. items. contains ( where: { $0. itemIdentifier. rawValue == " lock-file " } )
948+ )
949+ }
916950}
0 commit comments