@@ -622,23 +622,26 @@ describe('Content Tests', { concurrent: true }, () => {
622
622
const shortName = Tools . makeid ( 8 ) ;
623
623
const createLib = await connection . runCommand ( { command : `RUNSQL 'create schema "${ longName } " for ${ shortName } ' commit(*none)` , noLibList : true } ) ;
624
624
if ( createLib . code === 0 ) {
625
- const result = await connection . runCommand ( { command : `CRTSRCPF FILE(${ shortName } /SFILE) MBR(MBR) TEXT('Test long library name')` } ) ;
626
-
627
- const libraries = await content . getLibraries ( { library : `${ shortName } ` } ) ;
628
- expect ( libraries ?. length ) . toBe ( 1 ) ;
625
+ try {
626
+ await connection . runCommand ( { command : `CRTSRCPF FILE(${ shortName } /SFILE) MBR(MBR) TEXT('Test long library name')` } ) ;
629
627
630
- const objects = await content . getObjectList ( { library : `${ shortName } ` , types : [ `*SRCPF` ] , object : `SFILE` } ) ;
631
- expect ( objects ?. length ) . toBe ( 1 ) ;
632
- expect ( objects [ 0 ] . type ) . toBe ( `*FILE` ) ;
633
- expect ( objects [ 0 ] . text ) . toBe ( `Test long library name` ) ;
628
+ const libraries = await content . getLibraries ( { library : `${ shortName } ` } ) ;
629
+ expect ( libraries ?. length ) . toBe ( 1 ) ;
634
630
635
- const memberCount = await content . countMembers ( { library : `${ shortName } ` , name : `SFILE` } ) ;
636
- expect ( memberCount ) . toBe ( 1 ) ;
637
- const members = await content . getMemberList ( { library : `${ shortName } ` , sourceFile : `SFILE` } ) ;
631
+ const objects = await content . getObjectList ( { library : `${ shortName } ` , types : [ `*SRCPF` ] , object : `SFILE` } ) ;
632
+ expect ( objects ?. length ) . toBe ( 1 ) ;
633
+ expect ( objects [ 0 ] . type ) . toBe ( `*FILE` ) ;
634
+ expect ( objects [ 0 ] . text ) . toBe ( `Test long library name` ) ;
638
635
639
- expect ( members ?. length ) . toBe ( 1 ) ;
636
+ const memberCount = await content . countMembers ( { library : `${ shortName } ` , name : `SFILE` } ) ;
637
+ expect ( memberCount ) . toBe ( 1 ) ;
638
+ const members = await content . getMemberList ( { library : `${ shortName } ` , sourceFile : `SFILE` } ) ;
640
639
641
- await connection . runCommand ( { command : `RUNSQL 'drop schema "${ longName } "' commit(*none)` , noLibList : true } ) ;
640
+ expect ( members ?. length ) . toBe ( 1 ) ;
641
+ }
642
+ finally {
643
+ await connection . runCommand ( { command : `RUNSQL 'drop schema "${ longName } "' commit(*none)` , noLibList : true } ) ;
644
+ }
642
645
} else {
643
646
throw new Error ( `Failed to create schema "${ longName } "` ) ;
644
647
}
@@ -737,7 +740,7 @@ describe('Content Tests', { concurrent: true }, () => {
737
740
await connection . sendCommand ( { command : `${ connection . remoteFeatures . attr } ${ directory } /${ ccsid37File } CCSID=37` } ) ;
738
741
await checkFile ( `${ directory } /${ ccsid37File } ` , 37 ) ;
739
742
const files = [ `${ directory } /${ unicodeFile } ` , `${ directory } /${ ccsid37File } ` ] ;
740
-
743
+
741
744
expect ( ( await connection . sendCommand ( { command : `mkdir ${ directory } /copy` } ) ) . code ) . toBe ( 0 ) ;
742
745
expect ( ( await content . copy ( files , `${ directory } /copy` ) ) . code ) . toBe ( 0 ) ;
743
746
expect ( await content . testStreamFile ( `${ directory } /${ unicodeFile } ` , "f" ) ) . toBe ( true ) ;
0 commit comments