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

fix(hasMacroNameInMend): linting through comments

This commit is contained in:
Saad Jutt
2021-04-05 21:56:28 +05:00
parent a0e2c2d843
commit 5782886bdc
2 changed files with 21 additions and 7 deletions

View File

@@ -149,12 +149,17 @@ describe('hasMacroNameInMend', () => {
})
})
describe('with extra spaces ', () => {
describe('with extra spaces and comments', () => {
it('should return an empty array when %mend has correct macro name', () => {
const content = `
/* 1st comment */
%macro somemacro ;
%put &sysmacroname;
%mend somemacro ;`
/* 2nd
comment */
/* 3rd comment */ %mend somemacro ;`
expect(hasMacroNameInMend.test(content)).toEqual([])
})
@@ -162,9 +167,9 @@ describe('hasMacroNameInMend', () => {
it('should return an array with a single diagnostic when %mend has incorrect macro name', () => {
const content = `
%macro somemacro;
/* some comments */
%put &sysmacroname;
/* some comments */
%mend someanothermacro ;`
expect(hasMacroNameInMend.test(content)).toEqual([
@@ -181,7 +186,7 @@ describe('hasMacroNameInMend', () => {
it('should return an array with a single diagnostic when %mend has no macro name', () => {
const content = `
%macro somemacro ;
%put &sysmacroname;
/* some comments */%put &sysmacroname;
%mend ;`
expect(hasMacroNameInMend.test(content)).toEqual([