GHHG10/CodeServer / opencode /packages /tui /test /util /revert-diff.test.ts
GHHG10's picture
download
raw
766 Bytes
import { describe, expect, test } from "bun:test"
import { getRevertDiffFiles } from "../../src/util/revert-diff"
describe("revert diff", () => {
test("prefers the actual file path over /dev/null for added and deleted files", () => {
const files = getRevertDiffFiles(`diff --git a/new.txt b/new.txt
new file mode 100644
index 0000000..3b18e51
--- /dev/null
+++ b/new.txt
@@ -0,0 +1 @@
+new content
diff --git a/old.txt b/old.txt
deleted file mode 100644
index 3b18e51..0000000
--- a/old.txt
+++ /dev/null
@@ -1 +0,0 @@
-old content
`)
expect(files).toEqual([
{
filename: "new.txt",
additions: 1,
deletions: 0,
},
{
filename: "old.txt",
additions: 0,
deletions: 1,
},
])
})
})

Xet Storage Details

Size:
766 Bytes
·
Xet hash:
f1cc9e76d9170932908a2a8ef799fbec5ad40d87bf54a3d29a672c4a0da9dc2a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.