mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-14 19:45:49 +00:00
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.
20 lines
557 B
Swift
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)
|
|
}
|
|
}
|