1
0
mirror of https://github.com/sasjs/lint.git synced 2025-12-10 17:34:36 +00:00

tests(hasMacroNameInMend): Added more

This commit is contained in:
Saad Jutt
2021-04-21 03:27:24 +05:00
parent 93124bec5b
commit 6fd941aa2d

View File

@@ -339,10 +339,32 @@ describe('hasMacroNameInMend', () => {
}
])
})
it('should add macro name to the mend statement if not present', () => {
const content = `%macro somemacro();\n%put &sysmacroname;\n%mend;`
const expectedContent = `%macro somemacro();\n%put &sysmacroname;\n%mend somemacro;\n`
const content = ` %macro somemacro;\n %put &sysmacroname;\n %mend;`
const expectedContent = ` %macro somemacro;\n %put &sysmacroname;\n %mend somemacro;`
const formattedContent = hasMacroNameInMend.fix!(content, new LintConfig())
expect(formattedContent).toEqual(expectedContent)
})
it('should add macro name to the mend statement if not present ( with multiple macros )', () => {
const content = `
%macro somemacro;
%put &sysmacroname;
%mend somemacro;
%macro somemacro2;
%put &sysmacroname2;
%mend;`
const expectedContent = `
%macro somemacro;
%put &sysmacroname;
%mend somemacro;
%macro somemacro2;
%put &sysmacroname2;
%mend somemacro2;`
const formattedContent = hasMacroNameInMend.fix!(content, new LintConfig())