@@ -20,7 +20,7 @@ func TestParseDestinationDefault(t *testing.T) {
2020 now := time .Date (2026 , 5 , 11 , 21 , 4 , 32 , 0 , time .UTC )
2121 got , err := snapshot .ParseDestination ("" , now )
2222 require .NoError (t , err )
23- assert .Equal (t , filepath .Join (wd , "snapshot-2026-05-11T21-04-32" ), got )
23+ assert .Equal (t , filepath .Join (wd , "snapshot-2026-05-11T21-04-32.zip " ), got )
2424}
2525
2626func TestParseDestination (t * testing.T ) {
@@ -41,23 +41,31 @@ func TestParseDestination(t *testing.T) {
4141 tests := []testCase {
4242 {
4343 input : "./my-state" ,
44- wantPath : filepath .Join (wd , "my-state" ),
44+ wantPath : filepath .Join (wd , "my-state.zip " ),
4545 },
4646 {
4747 input : filepath .Join (os .TempDir (), "state" ),
48- wantPath : filepath .Join (os .TempDir (), "state" ),
48+ wantPath : filepath .Join (os .TempDir (), "state.zip " ),
4949 },
5050 {
5151 input : "~" ,
52- wantPath : home ,
52+ wantPath : home + ".zip" ,
5353 },
5454 {
5555 input : "~/snapshots/s" ,
56- wantPath : filepath .Join (home , "snapshots" , "s" ),
56+ wantPath : filepath .Join (home , "snapshots" , "s.zip " ),
5757 },
5858 {
5959 input : "subdir/state" ,
60- wantPath : filepath .Join (wd , "subdir" , "state" ),
60+ wantPath : filepath .Join (wd , "subdir" , "state.zip" ),
61+ },
62+ {
63+ input : "./checkpoint.zip" ,
64+ wantPath : filepath .Join (wd , "checkpoint.zip" ),
65+ },
66+ {
67+ input : "./already.ZIP" ,
68+ wantPath : filepath .Join (wd , "already.ZIP" ),
6169 },
6270 {
6371 input : "my-pod" ,
@@ -75,9 +83,9 @@ func TestParseDestination(t *testing.T) {
7583
7684 if runtime .GOOS == "windows" {
7785 tests = append (tests ,
78- testCase {input : `~\snapshots\s` , wantPath : filepath .Join (home , "snapshots" , "s" )},
79- testCase {input : `C:\Users\user\snap` , wantPath : `C:\Users\user\snap` },
80- testCase {input : `C:/Users/user/snap` , wantPath : `C:\Users\user\snap` },
86+ testCase {input : `~\snapshots\s` , wantPath : filepath .Join (home , "snapshots" , "s.zip " )},
87+ testCase {input : `C:\Users\user\snap` , wantPath : `C:\Users\user\snap.zip ` },
88+ testCase {input : `C:/Users/user/snap` , wantPath : `C:\Users\user\snap.zip ` },
8189 )
8290 }
8391
@@ -88,7 +96,7 @@ func TestParseDestination(t *testing.T) {
8896 if tc .wantErr != "" {
8997 require .Error (t , err )
9098 assert .Contains (t , err .Error (), tc .wantErr )
91- assert .Contains (t , err .Error (), "./my-snapshot" )
99+ assert .Contains (t , err .Error (), "./my-snapshot.zip " )
92100 return
93101 }
94102 require .NoError (t , err )
0 commit comments