@@ -12,6 +12,14 @@ struct TerminfoCompatibilityTests {
1212 )
1313 }
1414
15+ private func swiftTermFixtureURL( ) throws -> URL {
16+ try #require(
17+ Bundle . module. url ( forResource: " swifterm-terminfo " , withExtension: " infocmp " )
18+ ?? Bundle . module. url ( forResource: " swifterm-terminfo " , withExtension: " infocmp " ,
19+ subdirectory: " Fixtures " )
20+ )
21+ }
22+
1523 private func fixtureCapabilities( ) throws -> ( names: [ String ] , values: [ String : String ] ) {
1624 let text = try String ( contentsOf: fixtureURL ( ) , encoding: . utf8)
1725 let lines = text. split ( whereSeparator: \. isNewline) . map {
@@ -33,12 +41,7 @@ struct TerminfoCompatibilityTests {
3341 }
3442
3543 @Test func swiftTermEntryMatchesTheFixedGhosttyCapabilities( ) throws {
36- let repository = URL ( fileURLWithPath: #filePath)
37- . deletingLastPathComponent ( )
38- . deletingLastPathComponent ( )
39- . deletingLastPathComponent ( )
40- let swiftTermURL = repository. appendingPathComponent ( " swifterm-terminfo " )
41- let swiftTermText = try String ( contentsOf: swiftTermURL, encoding: . utf8)
44+ let swiftTermText = try String ( contentsOf: swiftTermFixtureURL ( ) , encoding: . utf8)
4245 let fixtureText = try String ( contentsOf: fixtureURL ( ) , encoding: . utf8)
4346 let swiftTermLines = swiftTermText. split ( whereSeparator: \. isNewline)
4447 let fixtureLines = fixtureText. split ( whereSeparator: \. isNewline)
0 commit comments