2023-03-09 20:43:05 +08:00
|
|
|
import cscFile from '../.github/csc.json';
|
2020-06-13 01:46:25 +08:00
|
|
|
describe('csc tests', () => {
|
|
|
|
it('Valid regular expression', async () => {
|
2023-03-09 20:43:05 +08:00
|
|
|
const regex = cscFile['problemMatcher'][0]['pattern'][0]['regexp'];
|
2020-06-13 01:46:25 +08:00
|
|
|
|
|
|
|
console.log(regex);
|
2023-03-09 20:43:05 +08:00
|
|
|
const re = new RegExp(regex);
|
2020-06-13 01:46:25 +08:00
|
|
|
|
|
|
|
// Ideally we would verify that this
|
2023-03-09 20:43:05 +08:00
|
|
|
const stringsToMatch = [
|
2020-06-13 01:46:25 +08:00
|
|
|
'Program.cs(10,79): error CS1002: ; expected [/Users/zacharyeisinger/Documents/repo/setup-dotnet/__tests__/sample-broken-csproj/sample.csproj]',
|
|
|
|
"S:\\Msbuild\\src\\Build\\Evaluation\\ExpressionShredder.cs(33,7): error CS1003: Syntax error, ',' expected [S:\\msbuild\\src\\Build\\Microsoft.Build.csproj > Properties:prop]"
|
|
|
|
];
|
|
|
|
|
|
|
|
stringsToMatch.forEach(string => {
|
2023-03-09 20:43:05 +08:00
|
|
|
const matchStr = string.match(re);
|
2020-06-13 01:46:25 +08:00
|
|
|
console.log(matchStr);
|
|
|
|
expect(matchStr).toEqual(expect.anything());
|
|
|
|
});
|
|
|
|
}, 10000);
|
|
|
|
});
|