Skip to content

Commit

Permalink
Add test for member resolve with variant characters
Browse files Browse the repository at this point in the history
  • Loading branch information
chrjorgensen committed Mar 20, 2024
1 parent f9b7a04 commit 25cd332
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/testing/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 25cd332

Please sign in to comment.