all repos

viye @ 61f333dd9d3dfd9ce05a1a68ad856e552c604287

my shot at reimplementing xiki
4 files changed, 12 insertions(+), 11 deletions(-)
update some inconsistencies
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2026-08-28 16:32:22 +0300
Authored at: 2026-08-28 16:32:05 +0300
Change ID: yqsruutusmlmlkuvwqmpynwpproyzwvw
Parent: 73be6e3
M internal/plumbing/files/files_test.go
···
        66
        66
         

      
        67
        67
         func TestResolve(t *testing.T) {

      
        68
        68
         	home, _ := os.UserHomeDir()

      
        69
        
        -	tests := []struct{ p, dir, want string }{

      
        
        69
        +	tests := []struct{ path, dir, want string }{

      
        70
        70
         		{"~", ".", home},

      
        71
        71
         		{"~/foo", ".", filepath.Join(home, "foo")},

      
        72
        72
         		{"/abs/path", ".", "/abs/path"},

      ···
        75
        75
         		{"..", "/base/sub", "/base"},

      
        76
        76
         	}

      
        77
        77
         	for _, tt := range tests {

      
        78
        
        -		got := resolve(tt.p, tt.dir)

      
        
        78
        +		got := resolve(tt.path, tt.dir)

      
        79
        79
         		is.Equal(t, tt.want, got)

      
        80
        80
         	}

      
        81
        81
         }

      
M internal/plumbing/http/http_test.go
···
        18
        18
         		"put":    true,

      
        19
        19
         		"patch":  true,

      
        20
        20
         		"delete": true,

      
        21
        
        -		"ls":     false,

      
        22
        21
         		"empty":  false,

      
        23
        22
         		"":       false,

      
        24
        23
         	}

      ···
        130
        129
         			wantBody:    "plain text body",

      
        131
        130
         		},

      
        132
        131
         	}

      
        133
        
        -	for _, tt := range tests {

      
        134
        
        -		headers, body, err := parseBody(tt.inp)

      
        135
        
        -		is.Err(t, err, nil)

      
        136
        
        -		is.Equal(t, tt.wantHeaders, headers)

      
        137
        
        -		is.Equal(t, tt.wantBody, body)

      
        
        132
        +	for tname, tt := range tests {

      
        
        133
        +		t.Run(tname, func(t *testing.T) {

      
        
        134
        +			headers, body, err := parseBody(tt.inp)

      
        
        135
        +			is.Err(t, err, nil)

      
        
        136
        +			is.Equal(t, tt.wantHeaders, headers)

      
        
        137
        +			is.Equal(t, tt.wantBody, body)

      
        
        138
        +		})

      
        138
        139
         	}

      
        139
        140
         }

      
M internal/plumbing/json/json_test.go
···
        65
        65
         			want: `| {"name":""}` + "\n",

      
        66
        66
         		},

      
        67
        67
         	}

      
        68
        
        -	for name, tt := range tests {

      
        69
        
        -		t.Run(name, func(t *testing.T) {

      
        
        68
        +	for tname, tt := range tests {

      
        
        69
        +		t.Run(tname, func(t *testing.T) {

      
        70
        70
         			got, err := (Tool{}).Execute(&viye.Context{Cmd: "json", Body: tt.body})

      
        71
        71
         			is.Err(t, err, nil)

      
        72
        72
         			is.Equal(t, tt.want, got)

      
M internal/plumbing/url/url.go
···
        9
        9
         

      
        10
        10
         type Tool struct{}

      
        11
        11
         

      
        12
        
        -func (Tool) Name() string { return "url(http://.*, https://.*)" }

      
        
        12
        +func (Tool) Name() string { return "url(http://*, https://*)" }

      
        13
        13
         func (Tool) Match(c *viye.Context) bool {

      
        14
        14
         	return strings.HasPrefix(c.Cmd, "http://") || strings.HasPrefix(c.Cmd, "https://")

      
        15
        15
         }