File tree Expand file tree Collapse file tree
Tests/NextcloudKitUnitTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,6 +101,31 @@ class FileNameValidatorUnitTests: XCTestCase {
101101
102102 func testFilePathWithNestedFolder( ) {
103103 let folderPath = " validFolder/secondValidFolder/CON "
104+ let filePaths = [ " file1.txt " , " file2.doc " , " file3. " ]
105+
106+ let result = fileNameValidator. checkFolderPath ( folderPath)
107+ XCTAssertFalse ( result)
108+
109+ filePaths. forEach { path in
110+ let result = fileNameValidator. checkFileName ( path)
111+
112+ if path == " file3. " {
113+ XCTAssertNotNil ( result? . errorDescription)
114+ } else {
115+ XCTAssertNil ( result? . errorDescription)
116+ }
117+ }
118+ }
119+
120+ func testOnlyFolderPath( ) {
121+ let folderPath = " /A1/Aaaww/W/C2/ "
122+
123+ let result = fileNameValidator. checkFolderPath ( folderPath)
124+ XCTAssertTrue ( result)
125+ }
126+
127+ func testOnlyFolderPathWithOneReservedName( ) {
128+ let folderPath = " /A1/Aaaww/CON/W/C2/ "
104129
105130 let result = fileNameValidator. checkFolderPath ( folderPath)
106131 XCTAssertFalse ( result)
You can’t perform that action at this time.
0 commit comments