Files
ghostty/macos/Tests/Ghostty/ShellTests.swift
Jon Parise df6feba417 macos: rename shellQuoted() to Ghostty.Shell.quote()
We already had an established Ghostty.Shell namespace (previously a
struct; now a more idiomatic enum), and locating these functions next to
each other makes it clearer how they relate to one another.
2026-02-16 15:27:57 -05:00

20 lines
557 B
Swift

import Testing
@testable import Ghostty
struct ShellTests {
@Test(arguments: [
("", "''"),
("filename", "filename"),
("abcABC123@%_-+=:,./", "abcABC123@%_-+=:,./"),
("file name", "'file name'"),
("file$name", "'file$name'"),
("file!name", "'file!name'"),
("file\\name", "'file\\name'"),
("it's", "'it'\"'\"'s'"),
("file$'name'", "'file$'\"'\"'name'\"'\"''"),
])
func quote(input: String, expected: String) {
#expect(Ghostty.Shell.quote(input) == expected)
}
}