From 25cd332d3486b64832b4b6b6e544aef1c4d820e1 Mon Sep 17 00:00:00 2001 From: Christian Jorgensen Date: Wed, 20 Mar 2024 14:13:20 +0100 Subject: [PATCH] Add test for member resolve with variant characters --- src/testing/content.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/testing/content.ts b/src/testing/content.ts index c4c0a2da5..91ba14e02 100644 --- a/src/testing/content.ts +++ b/src/testing/content.ts @@ -52,6 +52,43 @@ export const ContentSuite: TestSuite = { } }, + { + name: `Test memberResolve with variants`, test: async () => { + const content = instance.getContent(); + const config = instance.getConfig(); + const connection = instance.getConnection(); + const tempLib = config!.tempLibrary, + tempSPF = `O_ABC`.concat(connection!.variantChars.local), + tempMbr = `O_ABC`.concat(connection!.variantChars.local); + + const result = await connection!.runCommand({ + command: `CRTSRCPF ${tempLib}/${tempSPF} MBR(${tempMbr})`, + environment: `ile` + }); + + const member = await content?.memberResolve(tempMbr, [ + { library: `QSYSINC`, name: `MIH` }, // Doesn't exist here + { library: `NOEXIST`, name: `SUP` }, // Doesn't exist here + { library: tempLib, name: tempSPF } // Doesn't exist here + ]); + + assert.deepStrictEqual(member, { + asp: undefined, + library: tempLib, + file: tempSPF, + name: tempMbr, + extension: `MBR`, + basename: `${tempMbr}.MBR` + }); + + // Cleanup... + await connection!.runCommand({ + command: `DLTF ${tempLib}/${tempSPF}`, + environment: `ile` + }); + } + }, + { name: `Test memberResolve with bad name`, test: async () => { const content = instance.getContent();