fork/gdu

git clone https://git.julia.blue/fork/gdu

Daniel Mildefeat: shorten current item path to 70 chars #172c26b6c8

subvolume
485 B15 linesraw
1package path
2
3import (
4	"testing"
5
6	"github.com/stretchr/testify/assert"
7)
8
9func TestShortenPath(t *testing.T) {
10	assert.Equal(t, "/root", ShortenPath("/root", 10))
11	assert.Equal(t, "/home/.../foo", ShortenPath("/home/dundee/foo", 10))
12	assert.Equal(t, "/home/dundee/foo", ShortenPath("/home/dundee/foo", 50))
13	assert.Equal(t, "/home/dundee/.../bar.txt", ShortenPath("/home/dundee/foo/bar.txt", 20))
14	assert.Equal(t, "/home/.../bar.txt", ShortenPath("/home/dundee/foo/bar.txt", 15))
15}