Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dcfc938

Browse filesBrowse files
committed
fixed test regex
1 parent 8bd933f commit dcfc938
Copy full SHA for dcfc938

File tree

Expand file treeCollapse file tree

1 file changed

+2
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-7
lines changed

‎src/Dotnet.Script.Tests/EnvironmentTests.cs

Copy file name to clipboardExpand all lines: src/Dotnet.Script.Tests/EnvironmentTests.cs
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@ public class EnvironmentTests
1515
public void ShouldPrintVersionNumber(string versionFlag)
1616
{
1717
var result = ScriptTestRunner.Default.Execute(versionFlag);
18-
19-
if (result.exitCode != 0)
20-
{
21-
Console.WriteLine(result.output);
22-
}
23-
2418
Assert.Equal(0, result.exitCode);
2519
// TODO test that version appears on first line of output!
26-
Assert.Matches(@"^[0-9]+(\.[0-9]+){2}$", result.output);
20+
// semver regex from https://github.com/semver/semver/issues/232#issue-48635632
21+
Assert.Matches(@"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$", result.output);
2722
}
2823

2924
[Fact]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.