fork/gdu
git clone https://git.julia.blue/fork/gdu
c26b6c8
master
1package path 2 3import ( 4"testing" 5 6"github.com/stretchr/testify/assert" 7) 8 9func TestShortenPath (t * testing.T ) { 10assert .Equal (t ,"/root" ,ShortenPath ("/root" ,10 )) 11assert .Equal (t ,"/home/.../foo" ,ShortenPath ("/home/dundee/foo" ,10 )) 12assert .Equal (t ,"/home/dundee/foo" ,ShortenPath ("/home/dundee/foo" ,50 )) 13assert .Equal (t ,"/home/dundee/.../bar.txt" ,ShortenPath ("/home/dundee/foo/bar.txt" ,20 )) 14assert .Equal (t ,"/home/.../bar.txt" ,ShortenPath ("/home/dundee/foo/bar.txt" ,15 )) 15}