Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Remove testWritesThenCloseThenReopenWithVars #891

Merged
merged 1 commit into from
Sep 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 0 additions & 70 deletions xcode/Subconscious/SubconsciousTests/Tests_Sphere.swift
Original file line number Diff line number Diff line change
Expand Up @@ -448,76 +448,6 @@ final class Tests_Sphere: XCTestCase {
}
}

func testWritesThenCloseThenReopenWithVars() async throws {
let base = UUID()

let globalStoragePath = try createTmpDir(path: "\(base)/noosphere")
.path()

let sphereStoragePath = try createTmpDir(path: "\(base)/sphere")
.path()

var noosphere = try Noosphere(
globalStoragePath: globalStoragePath,
sphereStoragePath: sphereStoragePath
)

let sphereReceipt = try await noosphere.createSphere(
ownerKeyName: "bob"
)

let sphereIdentity = sphereReceipt.identity

var sphere = try Sphere(
noosphere: noosphere,
identity: sphereReceipt.identity
)

let versionA0 = try await sphere.version()

let body = try "Test content".toData().unwrap()
let contentType = "text/subtext"
try await sphere.write(
slug: Slug("a")!,
contentType: contentType,
body: body
)

let versionA1 = try await sphere.save()

try await sphere.write(
slug: Slug("b")!,
contentType: contentType,
body: body
)
try await sphere.write(
slug: Slug("c")!,
contentType: contentType,
body: body
)
let versionA2 = try await sphere.save()

let versionAN = try await sphere.version()

XCTAssertNotEqual(versionA0, versionAN)
XCTAssertNotEqual(versionA1, versionAN)
XCTAssertEqual(versionA2, versionAN)

// Overwrite var with new instance
noosphere = try Noosphere(
globalStoragePath: globalStoragePath,
sphereStoragePath: sphereStoragePath
)
// Overwrite sphere with new sphere
sphere = try Sphere(
noosphere: noosphere,
identity: sphereIdentity
)
let versionB0 = try await sphere.version()

XCTAssertEqual(versionB0, versionAN)
}

func testPetnameRoundtrip() async throws {
let base = UUID()

Expand Down