guardia-messenger/node_modules/expo-file-system/ios/Tests/EXFileSystemSpec.swift
DESKTOP-TKLFCPRython f29f525c77 refactor: 101.79.17.164 → zioinfo.co.kr 전체 도메인 변환 + Manager UI 배포
- 37개 파일 IP → zioinfo.co.kr 치환 (소스/매뉴얼/설정/하네스)
- Manager DrConsole/NetworkConsole/CsapConsole 빌드 + /var/www/manager/ 배포
- 테스트: Manager HTTP 200, ITSM 신규 API 7개 전체 200

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 10:09:17 +09:00

56 lines
2.1 KiB
Swift

import ExpoModulesTestCore
@testable import ExpoModulesCore
@testable import ExpoFileSystem
class EXFileSystemSpec: ExpoSpec {
override class func spec() {
let fileSystem = EXFileSystem()
describe("percentEncodedURLFromURIString") {
it("should handle encoded URIs") {
let encodedUriInput = "file:///var/mobile/@username/branch"
let encodedUriExpectedOutput = "file:///var/mobile/@username/branch"
let encodedUri = fileSystem.percentEncodedURL(fromURIString: encodedUriInput)
expect(encodedUri?.absoluteString) == encodedUriExpectedOutput
expect(encodedUri?.scheme) == "file"
}
it("should handle UTF-8 characters") {
let utf8UriInput = "file:///var/mobile/中文"
let utf8UriExpectedOutput = "file:///var/mobile/%E4%B8%AD%E6%96%87"
let utf8Uri = fileSystem.percentEncodedURL(fromURIString: utf8UriInput)
expect(utf8Uri?.absoluteString) == utf8UriExpectedOutput
expect(utf8Uri?.scheme) == "file"
}
it("should handle URI with percent, numbers and UTF-8 characters") {
let input = "file:///document/directory/%40%2F中文"
let expectedOutput = "file:///document/directory/%40%2F%E4%B8%AD%E6%96%87"
let uri = fileSystem.percentEncodedURL(fromURIString: input)
expect(uri?.absoluteString) == expectedOutput
}
it("should not decode percentages in URI") {
let input = "file:///document/hello%2Fworld.txt"
let unexpectedOutput = "file:///document/hello/world.txt"
let uri = fileSystem.percentEncodedURL(fromURIString: input)
// Should not create a directory named "hello"
expect(uri?.absoluteString) != unexpectedOutput
}
it("should handle assets-library URIs") {
let assetsLibraryUriInput = "assets-library://asset/asset.JPG?id=3C1D9C54-9521-488F-BB27-AA1EA0F8AF04/L0/001&ext=JPG"
let assetsLibraryUri = fileSystem.percentEncodedURL(fromURIString: assetsLibraryUriInput)
expect(assetsLibraryUri?.absoluteString) == assetsLibraryUriInput
expect(assetsLibraryUri?.scheme) == "assets-library"
}
}
}
}