all repos

viye @ 689bbb9092314ac54125859f8e827ca7d51d48fa

my shot at reimplementing xiki
3 files changed, 9 insertions(+), 7 deletions(-)
fix files tests
Author: Oleksandr Smirnov olexsmir@gmail.com
Committed at: 2026-07-23 15:36:20 +0300
Authored at: 2026-07-23 14:48:38 +0300
Change ID: sxtxywossupooymtxrrolqtkurukmwkl
Parent: fd029ec
M internal/plumbing/files/files.go
···
        38
        38
         			if err != nil {

      
        39
        39
         				return "", err

      
        40
        40
         			}

      
        41
        
        -			return viye.FormatBulletlist(ls), nil

      
        
        41
        +			return viye.FormatOutput(ls), nil

      
        42
        42
         		}

      
        43
        43
         		ctx.Dir = path

      
        44
        44
         		ctx.Path = ctx.Path[1:]

      
M internal/plumbing/files/files_test.go
···
        45
        45
         		if err != nil {

      
        46
        46
         			t.Fatal(err)

      
        47
        47
         		}

      
        48
        
        -		if got != "- x\n" {

      
        49
        
        -			t.Errorf("Execute = %q; want %q", got, "x\\n")

      
        
        48
        +		want := "| x\n"

      
        
        49
        +		if got != want {

      
        
        50
        +			t.Errorf("Execute = %q; want %q", got, want)

      
        50
        51
         		}

      
        51
        52
         	})

      
        52
        53
         

      ···
        62
        63
         		if err := v.Run(&out, []string{"viye", dir, "sub"}); err != nil {

      
        63
        64
         			t.Fatal(err)

      
        64
        65
         		}

      
        65
        
        -		if out.String() != "y\n" {

      
        66
        
        -			t.Errorf("Run = %q; want %q", out.String(), "y\\n")

      
        
        66
        +		want := "| y\n"

      
        
        67
        +		if out.String() != want {

      
        
        68
        +			t.Errorf("Run = %q; want %q", out.String(), want)

      
        67
        69
         		}

      
        68
        70
         	})

      
        69
        71
         

      
M internal/viye/format.go
···
        18
        18
         	return strings.Join(lines, "\n") + "\n"

      
        19
        19
         }

      
        20
        20
         

      
        21
        
        -func FormatBulletlist(s string) string {

      
        
        21
        +func FormatBulletList(s string) string {

      
        22
        22
         	lines := strings.Split(s, "\n")

      
        23
        23
         	for i, line := range lines {

      
        24
        24
         		if line != "" {

      
        25
        25
         			lines[i] = "- " + line

      
        26
        26
         		}

      
        27
        27
         	}

      
        28
        
        -	return strings.Join(lines, "\n") + "\n"

      
        
        28
        +	return strings.Join(lines, "\n")

      
        29
        29
         }