package path

import "testing"

func TestTrimExt(t *testing.T) {
	for _, tc := range []struct {
		name string
		want string
	}{
		{
			name: "客户电子缴税_815777777R520000002_202412061343024.pdf",
			want: "客户电子缴税_815777777R520000002_202412061343024",
		},
		{
			name: "a.b.c",
			want: "a.b",
		},
		{
			name: "a",
			want: "a",
		},
		{
			name: ".c",
			want: "",
		},
		{
			name: "",
			want: "",
		},
	} {
		r := TrimExt(tc.name)
		if r != tc.want {
			t.Errorf("Expected %v, but got %v", tc.want, r)
		}
	}
}
