fork/gdu

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

bingoohuangfeat: add --archive-browsing flag to show zip/jar files as dirs, add --collapse-path flag to for collapsing single-child directory chains (#434)516c421

master
798 B33 linesraw
1package tui
2
3import (
4	"testing"
5
6	"github.com/stretchr/testify/assert"
7)
8
9func TestCollapsedPathStruct(t *testing.T) {
10	// Test CollapsedPath struct creation and fields
11	cp := &CollapsedPath{
12		DisplayName: "test/path",
13		DeepestDir:  nil,
14		Segments:    []string{"test", "path"},
15	}
16
17	assert.Equal(t, "test/path", cp.DisplayName)
18	assert.Nil(t, cp.DeepestDir)
19	assert.Equal(t, []string{"test", "path"}, cp.Segments)
20}
21
22func TestFindCollapsedParentNilCases(t *testing.T) {
23	// Test nil input
24	result := findCollapsedParent(nil)
25	assert.Nil(t, result)
26}
27
28// Test that our new functions exist and don't panic with basic inputs
29func TestFunctionExistence(t *testing.T) {
30	// Test that findCollapsiblePath exists and handles nil gracefully
31	result := findCollapsiblePath(nil)
32	assert.Nil(t, result)
33}