@@ -21,7 +21,8 @@ async function runCommandsWithCCSID(connection: IBMi, commands: string[], ccsid:
2121 const config = connection . getConfig ( ) ;
2222
2323 const tempLib = config . tempLibrary ;
24- const testPgmName = connection . upperCaseName ( `T${ commands . length } ${ ccsid } ${ Tools . makeid ( 2 ) } ` ) ;
24+ const name = `T${ commands . length } ${ ccsid } ${ Tools . makeid ( 2 ) } ` . padEnd ( 10 ) . substring ( 0 , 10 ) . trim ( ) ;
25+ const testPgmName = connection . upperCaseName ( name ) ;
2526
2627 await connection . runCommand ( { command : `DLTOBJ OBJ(${ tempLib } /${ testPgmSrcFile } ) OBJTYPE(*FILE)` , noLibList : true } ) ;
2728 await connection . runCommand ( { command : `DLTOBJ OBJ(${ tempLib } /${ testPgmName } ) OBJTYPE(*PGM)` , noLibList : true } ) ;
@@ -329,22 +330,22 @@ describe('Encoding tests', { concurrent: true }, () => {
329330
330331 await connection . runCommand ( { command : `DLTF FILE(${ tempLib } /${ testFile } )` , noLibList : true } ) ;
331332
332- const createResult = await runCommandsWithCCSID ( connection , [ `CRTSRCPF FILE(${ tempLib } /${ testFile } ) RCDLEN(112) CCSID(${ ccsidData . userDefaultCCSID } )` ] , ccsidData . userDefaultCCSID ) ;
333+ const createResult = await runCommandsWithCCSID ( connection , [ `CRTSRCPF FILE(${ tempLib } /${ testFile } ) RCDLEN(112) CCSID(${ ccsidData . runtimeCcsid } )` ] , ccsidData . runtimeCcsid ) ;
333334 expect ( createResult . code ) . toBe ( 0 ) ;
334335 try {
335336 const addPf = await connection . runCommand ( { command : `ADDPFM FILE(${ tempLib } /${ testFile } ) MBR(${ testMember } ) SRCTYPE(TXT)` , noLibList : true } ) ;
336337 expect ( addPf . code ) . toBe ( 0 ) ;
337338
338339 const attributes = await connection . getContent ( ) . getAttributes ( { library : tempLib , name : testFile , member : testMember } , `CCSID` ) ;
339340 expect ( attributes ) . toBeTruthy ( ) ;
340- expect ( attributes ! [ `CCSID` ] ) . toBe ( String ( ccsidData . userDefaultCCSID ) ) ;
341+ expect ( attributes ! [ `CCSID` ] ) . toBe ( String ( ccsidData . runtimeCcsid ) ) ;
341342
342343 const addPfB = await connection . runCommand ( { command : `ADDPFM FILE(${ tempLib } /${ testFile } ) MBR(${ variantMember } ) SRCTYPE(TXT)` , noLibList : true } ) ;
343344 expect ( addPfB . code ) . toBe ( 0 ) ;
344345
345346 const attributesB = await connection . getContent ( ) . getAttributes ( { library : tempLib , name : testFile , member : variantMember } , `CCSID` ) ;
346347 expect ( attributesB ) . toBeTruthy ( ) ;
347- expect ( attributesB ! [ `CCSID` ] ) . toBe ( String ( ccsidData . userDefaultCCSID ) ) ;
348+ expect ( attributesB ! [ `CCSID` ] ) . toBe ( String ( ccsidData . runtimeCcsid ) ) ;
348349
349350 const objects = await connection . getContent ( ) . getObjectList ( { library : tempLib , types : [ `*SRCPF` ] } ) ;
350351 expect ( objects . length ) . toBeTruthy ( ) ;
@@ -366,7 +367,6 @@ describe('Encoding tests', { concurrent: true }, () => {
366367 await connection . getContent ( ) . uploadMemberContent ( tempLib , testFile , testMember , [ `**free` , `dsply 'Hello world';` , ` ` , ` ` , `return;` ] . join ( `\n` ) ) ;
367368
368369 const compileResult = await connection . runCommand ( { command : `CRTBNDRPG PGM(${ tempLib } /${ testMember } ) SRCFILE(${ tempLib } /${ testFile } ) SRCMBR(${ testMember } )` , noLibList : true } ) ;
369- console . log ( compileResult ) ;
370370 expect ( compileResult . code ) . toBe ( 0 ) ;
371371
372372 await connection . runCommand ( { command : `DLTOBJ OBJ(${ tempLib } /${ testMember } ) OBJTYPE(*PGM)` , noLibList : true } ) ;
0 commit comments