Skip to content

Commit c493b04

Browse files
committed
Added the file required to create the new executable.
1 parent 24e8ad5 commit c493b04

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

TestFoundation/XDGTestHelper.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Foundation
2+
import XCTest
3+
4+
let storage = HTTPCookieStorage.shared
5+
let simpleCookie = HTTPCookie(properties: [
6+
.name: "TestCookie",
7+
.value: "Test @#$%^$&*99",
8+
.path: "/",
9+
.domain: "example.com",
10+
])!
11+
let rawValue = getenv("XDG_CONFIG_HOME")
12+
let xdg_config_home = String(utf8String: rawValue!)
13+
storage.setCookie(simpleCookie)
14+
XCTAssertEqual(storage.cookies!.count, 1)
15+
let fm = FileManager.default
16+
let destPath = xdg_config_home! + "/.cookies.shared"
17+
var isDir = false
18+
let exists = fm.fileExists(atPath: destPath, isDirectory: &isDir)
19+
XCTAssertTrue(exists)

0 commit comments

Comments
 (0)