Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 62b1eb7

Browse files
committed
Add an unit test to reproduce crash
See wordpress-mobile/WordPress-iOS#22891
1 parent 7d0757c commit 62b1eb7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

WordPressKitTests/PluginDirectoryTests.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,16 @@ class PluginDirectoryTests: XCTestCase {
343343

344344
XCTAssertTrue(lhs == rhs)
345345
}
346+
347+
func testUnconventionalPluginSlug() async throws {
348+
let data = try MockPluginDirectoryProvider.getPluginDirectoryMockData(with: "plugin-directory-rename-xml-rpc", sender: type(of: self))
349+
stub(condition: isHost("api.wordpress.org")) { _ in
350+
HTTPStubsResponse(data: data, statusCode: 200, headers: ["Content-Type": "application/json"])
351+
}
352+
353+
let _ = try await PluginDirectoryServiceRemote().getPluginInformation(slug: "%-is-not-allowed")
354+
let _ = try await PluginDirectoryServiceRemote().getPluginInformation(slug: "中文")
355+
356+
// No assertion needed.
357+
}
346358
}

0 commit comments

Comments
 (0)