@@ -142,7 +142,7 @@ describe('source archive uri encoding', function() {
142142 name : 'Empty path' ,
143143 input : {
144144 sourceArchiveZipPath : '/home/folder/src.zip' ,
145- pathWithinSourceArchive : ''
145+ pathWithinSourceArchive : '/ '
146146 }
147147 }
148148 ] ;
@@ -153,11 +153,22 @@ describe('source archive uri encoding', function() {
153153 } ) ;
154154 }
155155
156+ it ( 'should decode an empty path as a "/"' , ( ) => {
157+ const uri = encodeSourceArchiveUri ( {
158+ pathWithinSourceArchive : '' ,
159+ sourceArchiveZipPath : 'a/b/c'
160+ } ) ;
161+ expect ( decodeSourceArchiveUri ( uri ) ) . to . deep . eq ( {
162+ pathWithinSourceArchive : '/' ,
163+ sourceArchiveZipPath : 'a/b/c'
164+ } ) ;
165+ } ) ;
166+
156167 it ( 'should encode a uri at the root of the archive' , ( ) => {
157168 const path = '/a/b/c/src.zip' ;
158169 const uri = encodeArchiveBasePath ( path ) ;
159170 expect ( uri . path ) . to . eq ( path ) ;
160- expect ( decodeSourceArchiveUri ( uri ) . pathWithinSourceArchive ) . to . eq ( '' ) ;
171+ expect ( decodeSourceArchiveUri ( uri ) . pathWithinSourceArchive ) . to . eq ( '/ ' ) ;
161172 expect ( decodeSourceArchiveUri ( uri ) . sourceArchiveZipPath ) . to . eq ( path ) ;
162173 expect ( uri . authority ) . to . eq ( '0-14' ) ;
163174 } ) ;
@@ -168,7 +179,7 @@ describe('source archive uri encoding', function() {
168179 expect ( uri . authority ) . to . eq ( '' ) ;
169180 expect ( decodeSourceArchiveUri ( uri ) ) . to . deep . eq ( {
170181 sourceArchiveZipPath : '/a/b/c/src.zip' ,
171- pathWithinSourceArchive : ''
182+ pathWithinSourceArchive : '/ '
172183 } ) ;
173184 } ) ;
174185} ) ;
0 commit comments