Skip to content

Commit

Permalink
Fix code scanning alert no. 4: Useless regular-expression character e…
Browse files Browse the repository at this point in the history
…scape

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
cliffano and github-advanced-security[bot] authored Jan 13, 2025
1 parent 1ef2536 commit 07428ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/resource-types/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('text', function() {
path: 'somefile.txt',
type: 'text',
params: {
regex: '(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?'
regex: '(\\d+).(\\d+).(\\d+)(?:-([0-9A-Za-z-]+(?:.[0-9A-Za-z-]+)*))?'
}
};
this.mockFs.expects('readFileSync').once().withExactArgs('somefile.txt', 'UTF-8').returns(' version1 = "0.0.0", version2 = "1.1.1-beta" ');
Expand All @@ -75,7 +75,7 @@ describe('text', function() {
path: 'somefile.txt',
type: 'text',
params: {
regex: '(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?'
regex: '(\\d+).(\\d+).(\\d+)(?:-([0-9A-Za-z-]+(?:.[0-9A-Za-z-]+)*))?'
}
};
this.mockFs.expects('readFile').once().withExactArgs('somefile.txt', 'UTF-8', sinon.match.func).callsArgWith(2, null, ' version = "0.0.0" ');
Expand All @@ -91,7 +91,7 @@ describe('text', function() {
path: 'somefile.txt',
type: 'text',
params: {
regex: '(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?'
regex: '(\\d+).(\\d+).(\\d+)(?:-([0-9A-Za-z-]+(?:.[0-9A-Za-z-]+)*))?'
}
};
this.mockFs.expects('readFile').once().withExactArgs('somefile.txt', 'UTF-8', sinon.match.func).callsArgWith(2, null, ' version = "9.8.7" \n side_version = "1.2.3" ');
Expand All @@ -107,7 +107,7 @@ describe('text', function() {
path: 'somefile.txt',
type: 'text',
params: {
regex: '(\\d+)\\.(\\d+)\\.(\\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?'
regex: '(\\d+).(\\d+).(\\d+)(?:-([0-9A-Za-z-]+(?:.[0-9A-Za-z-]+)*))?'
}
};
this.mockFs.expects('readFile').once().withExactArgs('somefile.txt', 'UTF-8', sinon.match.func).callsArgWith(2, null, ' version = "1.1.1-pre.2" ');
Expand Down

0 comments on commit 07428ca

Please sign in to comment.