Skip to content

Commit cbcaab1

Browse files
committed
Add Status Parsing Test
1 parent 4f52020 commit cbcaab1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// GitClientTests.swift
3+
// CodeEditTests
4+
//
5+
// Created by Khan Winter on 9/11/25.
6+
//
7+
8+
import Testing
9+
@testable import CodeEdit
10+
11+
@Suite
12+
struct GitClientTests {
13+
@Test
14+
func statusParseNullAtEnd() throws {
15+
try withTempDir { dirURL in
16+
// swiftlint:disable:next line_length
17+
let string = "1 .M N... 100644 100644 100644 eaef31cfa2a22418c00d7477da0b7151d122681e eaef31cfa2a22418c00d7477da0b7151d122681e CodeEdit/Features/SourceControl/Client/GitClient+Status.swift\01 AM N... 000000 100644 100644 0000000000000000000000000000000000000000 e0f5ce250b32cf6610a284b7a33ac114079f5159 CodeEditTests/Features/SourceControl/GitClientTests.swift\0"
18+
let client = GitClient(directoryURL: dirURL, shellClient: .live())
19+
let status = try client.parseStatusString(string)
20+
21+
#expect(status.changedFiles.count == 2)
22+
// No null string at the end
23+
#expect(status.changedFiles[0].fileURL.lastPathComponent == "GitClient+Status.swift")
24+
#expect(status.changedFiles[1].fileURL.lastPathComponent == "GitClientTests.swift")
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)