Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created August 15, 2021 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/7513639004edb7b058e167614e8703f8 to your computer and use it in GitHub Desktop.
Save laevandus/7513639004edb7b058e167614e8703f8 to your computer and use it in GitHub Desktop.
func testStoreAndLoadAsync() async throws {
let identifier = try await dataStore.storeData({ "Data".data(using: .utf8) }, identifier: "abc")
XCTAssertEqual(identifier, "abc")
let string = await dataStore.loadData(forIdentifier: "abc", dataTransformer: { String(decoding: $0, as: UTF8.self) })
XCTAssertEqual(string, "Data")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment