34 lines
1.0 KiB
Swift
34 lines
1.0 KiB
Swift
//
|
|
// NSPasteboardTests.swift
|
|
// GhosttyTests
|
|
//
|
|
// Tests for NSPasteboard.PasteboardType MIME type conversion.
|
|
//
|
|
|
|
import Testing
|
|
import AppKit
|
|
@testable import Ghostty
|
|
|
|
struct NSPasteboardTypeExtensionTests {
|
|
/// Test text/plain MIME type converts to .string
|
|
@Test func testTextPlainMimeType() async throws {
|
|
let pasteboardType = NSPasteboard.PasteboardType(mimeType: "text/plain")
|
|
#expect(pasteboardType != nil)
|
|
#expect(pasteboardType == .string)
|
|
}
|
|
|
|
/// Test text/html MIME type converts to .html
|
|
@Test func testTextHtmlMimeType() async throws {
|
|
let pasteboardType = NSPasteboard.PasteboardType(mimeType: "text/html")
|
|
#expect(pasteboardType != nil)
|
|
#expect(pasteboardType == .html)
|
|
}
|
|
|
|
/// Test image/png MIME type
|
|
@Test func testImagePngMimeType() async throws {
|
|
let pasteboardType = NSPasteboard.PasteboardType(mimeType: "image/png")
|
|
#expect(pasteboardType != nil)
|
|
#expect(pasteboardType == .png)
|
|
}
|
|
}
|