style: fix formatting and indentation consistency
- Remove extra blank lines and fix indentation in test files - Ensure consistent struct field alignment in git types
This commit is contained in:
+15
-16
@@ -43,7 +43,7 @@ func TestParseGitDiffUnified(t *testing.T) {
|
||||
input: `@@ -10,2 +10,0 @@
|
||||
-deleted line 1
|
||||
-deleted line 2`,
|
||||
expected: []LineRange{},
|
||||
expected: []LineRange{},
|
||||
},
|
||||
{
|
||||
name: "no count specified (single line)",
|
||||
@@ -83,26 +83,26 @@ func TestIsInLineRanges(t *testing.T) {
|
||||
ranges := []LineRange{
|
||||
{Start: 5, End: 7},
|
||||
{Start: 10, End: 12},
|
||||
{Start: 20, End: 20},
|
||||
{Start: 20, End: 20},
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
lineNum int
|
||||
expected bool
|
||||
}{
|
||||
{1, false},
|
||||
{4, false},
|
||||
{5, true},
|
||||
{6, true},
|
||||
{7, true},
|
||||
{8, false},
|
||||
{10, true},
|
||||
{11, true},
|
||||
{12, true},
|
||||
{15, false},
|
||||
{20, true},
|
||||
{21, false},
|
||||
{100, false},
|
||||
{1, false},
|
||||
{4, false},
|
||||
{5, true},
|
||||
{6, true},
|
||||
{7, true},
|
||||
{8, false},
|
||||
{10, true},
|
||||
{11, true},
|
||||
{12, true},
|
||||
{15, false},
|
||||
{20, true},
|
||||
{21, false},
|
||||
{100, false},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
@@ -118,7 +118,6 @@ func TestIsInLineRanges(t *testing.T) {
|
||||
func TestIsInLineRangesEmptyRanges(t *testing.T) {
|
||||
var emptyRanges []LineRange
|
||||
|
||||
|
||||
testLines := []int{1, 5, 10, 100}
|
||||
for _, lineNum := range testLines {
|
||||
result := IsInLineRanges(lineNum, emptyRanges)
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package git
|
||||
|
||||
|
||||
type GitStatus struct {
|
||||
IsRepo bool
|
||||
RootDir string
|
||||
}
|
||||
|
||||
|
||||
type FileStatus int
|
||||
|
||||
const (
|
||||
@@ -15,15 +13,13 @@ const (
|
||||
StatusUntracked
|
||||
)
|
||||
|
||||
|
||||
type FileChange struct {
|
||||
Path string
|
||||
Status FileStatus
|
||||
LineRanges []LineRange
|
||||
LineRanges []LineRange
|
||||
}
|
||||
|
||||
|
||||
type LineRange struct {
|
||||
Start int
|
||||
End int
|
||||
Start int
|
||||
End int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user