Skip to content

Commit a4ec206

Browse files
author
Zachary Eisinger
authored
Merge pull request #98 from actions/csc-testing
Update install-dotnet.ps1 and add csc tests
2 parents 73683e5 + 232f64b commit a4ec206

File tree

2 files changed

+902
-686
lines changed

2 files changed

+902
-686
lines changed

__tests__/csc.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import fs = require('fs');
2+
3+
describe('csc tests', () => {
4+
it('Valid regular expression', async () => {
5+
var cscFile = require('../.github/csc.json');
6+
var regex = cscFile['problemMatcher'][0]['pattern'][0]['regexp'];
7+
8+
console.log(regex);
9+
var re = new RegExp(regex);
10+
11+
// Ideally we would verify that this
12+
var stringsToMatch = [
13+
'Program.cs(10,79): error CS1002: ; expected [/Users/zacharyeisinger/Documents/repo/setup-dotnet/__tests__/sample-broken-csproj/sample.csproj]',
14+
"S:\\Msbuild\\src\\Build\\Evaluation\\ExpressionShredder.cs(33,7): error CS1003: Syntax error, ',' expected [S:\\msbuild\\src\\Build\\Microsoft.Build.csproj > Properties:prop]"
15+
];
16+
17+
stringsToMatch.forEach(string => {
18+
var matchStr = string.match(re);
19+
console.log(matchStr);
20+
expect(matchStr).toEqual(expect.anything());
21+
});
22+
}, 10000);
23+
});

0 commit comments

Comments
 (0)