@@ -111,15 +111,14 @@ describe("GhostServiceManager", () => {
111111 expect ( result . suggestions . hasSuggestions ( ) ) . toBe ( false )
112112 } )
113113
114- it ( "should handle invalid XML format" , async ( ) => {
114+ it ( "should handle invalid COMPLETION format" , async ( ) => {
115115 const initialContent = `console.log('test');`
116116 const { context } = await setupTestDocument ( "invalid.js" , initialContent )
117117
118- // Test invalid XML format
119- const invalidXML = "This is not a valid XML format"
118+ const invalidCOMPLETION = "This is not a valid COMPLETION format"
120119 const position = context . range ?. start ?? context . document . positionAt ( 0 )
121120 const { prefix, suffix } = extractPrefixSuffix ( context . document , position )
122- const result = parseGhostResponse ( invalidXML , prefix , suffix )
121+ const result = parseGhostResponse ( invalidCOMPLETION , prefix , suffix )
123122 expect ( result . suggestions . hasSuggestions ( ) ) . toBe ( false )
124123 } )
125124
@@ -133,14 +132,12 @@ describe("GhostServiceManager", () => {
133132 openFiles : [ ] ,
134133 }
135134
136- // Use XML format
137- const xmlResponse = `<change><search><![CDATA[console.log('test');]]></search><replace><![CDATA[// Added comment
138- console.log('test');]]></replace></change>`
135+ const completionResponse = `<COMPLETION>// Added comment
136+ console.log('test');</COMPLETION>`
139137
140138 const position = context . range ?. start ?? context . document . positionAt ( 0 )
141139 const { prefix, suffix } = extractPrefixSuffix ( context . document , position )
142- const result = parseGhostResponse ( xmlResponse , prefix , suffix )
143- // Should work with the XML format
140+ const result = parseGhostResponse ( completionResponse , prefix , suffix )
144141 expect ( result . suggestions . hasSuggestions ( ) ) . toBe ( true )
145142 } )
146143 } )
0 commit comments