mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Fix test
This commit is contained in:
@@ -59,7 +59,10 @@ function calculateTotal(items: number[]): number {
|
|||||||
export { calculateTotal };`
|
export { calculateTotal };`
|
||||||
|
|
||||||
const result = strategy.applyDiff(originalContent, diffContent)
|
const result = strategy.applyDiff(originalContent, diffContent)
|
||||||
expect(result).toBe(expected)
|
expect(result.success).toBe(true)
|
||||||
|
if (result.success) {
|
||||||
|
expect(result.content).toBe(expected)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should successfully apply a diff adding a new method', () => {
|
it('should successfully apply a diff adding a new method', () => {
|
||||||
@@ -93,7 +96,10 @@ export { calculateTotal };`
|
|||||||
}`
|
}`
|
||||||
|
|
||||||
const result = strategy.applyDiff(originalContent, diffContent)
|
const result = strategy.applyDiff(originalContent, diffContent)
|
||||||
expect(result).toBe(expected)
|
expect(result.success).toBe(true)
|
||||||
|
if (result.success) {
|
||||||
|
expect(result.content).toBe(expected)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should successfully apply a diff modifying imports', () => {
|
it('should successfully apply a diff modifying imports', () => {
|
||||||
@@ -128,7 +134,10 @@ function App() {
|
|||||||
}`
|
}`
|
||||||
|
|
||||||
const result = strategy.applyDiff(originalContent, diffContent)
|
const result = strategy.applyDiff(originalContent, diffContent)
|
||||||
expect(result).toBe(expected)
|
expect(result.success).toBe(true)
|
||||||
|
if (result.success) {
|
||||||
|
expect(result.content).toBe(expected)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should successfully apply a diff with multiple hunks', () => {
|
it('should successfully apply a diff with multiple hunks', () => {
|
||||||
@@ -190,7 +199,10 @@ async function processFile(path: string) {
|
|||||||
export { processFile };`
|
export { processFile };`
|
||||||
|
|
||||||
const result = strategy.applyDiff(originalContent, diffContent)
|
const result = strategy.applyDiff(originalContent, diffContent)
|
||||||
expect(result).toBe(expected)
|
expect(result.success).toBe(true)
|
||||||
|
if (result.success) {
|
||||||
|
expect(result.content).toBe(expected)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should handle empty original content', () => {
|
it('should handle empty original content', () => {
|
||||||
@@ -207,7 +219,10 @@ export { processFile };`
|
|||||||
}\n`
|
}\n`
|
||||||
|
|
||||||
const result = strategy.applyDiff(originalContent, diffContent)
|
const result = strategy.applyDiff(originalContent, diffContent)
|
||||||
expect(result).toBe(expected)
|
expect(result.success).toBe(true)
|
||||||
|
if (result.success) {
|
||||||
|
expect(result.content).toBe(expected)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user