File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,25 @@ async fn zero_length_zip() {
3232 assert ! ( zip_reader_res. is_err( ) ) ;
3333}
3434
35+ #[ tokio:: test]
36+ async fn single_entry_with_comment ( ) {
37+ use crate :: read:: seek:: ZipFileReader ;
38+
39+ let comment = "Foo bar." ;
40+ let mut input_stream = Cursor :: new ( Vec :: < u8 > :: new ( ) ) ;
41+ let mut zip_writer = ZipFileWriter :: new ( & mut input_stream) ;
42+
43+ zip_writer. comment ( String :: from ( comment) ) ;
44+ zip_writer. close ( ) . await . expect ( "failed to close writer" ) ;
45+
46+ input_stream. set_position ( 0 ) ;
47+
48+ let zip_reader_res = ZipFileReader :: new ( & mut input_stream) . await . expect ( "failed to open reader" ) ;
49+
50+ assert ! ( zip_reader_res. comment( ) . is_some( ) ) ;
51+ assert_eq ! ( zip_reader_res. comment( ) . unwrap( ) , comment) ;
52+ }
53+
3554#[ tokio:: test]
3655async fn single_entry_no_data ( ) {
3756 use crate :: read:: seek:: ZipFileReader ;
You can’t perform that action at this time.
0 commit comments