1
0
mirror of https://github.com/sasjs/lint.git synced 2026-01-19 02:00:05 +00:00

fix(hasMacroParentheses): added additional test also

This commit is contained in:
Saad Jutt
2021-04-21 16:44:20 +05:00
parent db2dbb1c69
commit cd90b0850a
2 changed files with 19 additions and 2 deletions

View File

@@ -44,6 +44,21 @@ describe('hasMacroParentheses', () => {
])
})
it('should return an array with a single diagnostic when macro defined without name ( single line code )', () => {
const content = `
%macro (); %put &sysmacroname; %mend;`
expect(hasMacroParentheses.test(content)).toEqual([
{
message: 'Macro definition missing name',
lineNumber: 2,
startColumnNumber: 3,
endColumnNumber: 12,
severity: Severity.Warning
}
])
})
it('should return an array with a single diagnostic when macro defined without name and parentheses', () => {
const content = `
%macro ;
@@ -55,7 +70,7 @@ describe('hasMacroParentheses', () => {
message: 'Macro definition missing name',
lineNumber: 2,
startColumnNumber: 3,
endColumnNumber: 10,
endColumnNumber: 9,
severity: Severity.Warning
}
])