{
try
{
- const string frameParserRegex = @"\s+at\s.+\.(?<memberName>[^(.]+)\([^)]*\)\sin\s(?<filePath>.*)\:line\s(?<lineNumber>[\d]+)";
+ string frameParserRegex;
+ if (PlatformDetection.IsLineNumbersSupported)
+ {
+ frameParserRegex = @"\s+at\s.+\.(?<memberName>[^(.]+)\([^)]*\)\sin\s(?<filePath>.*)\:line\s(?<lineNumber>[\d]+)";
+ }
+ else
+ {
+ frameParserRegex = @"\s+at\s.+\.(?<memberName>[^(.]+)";
+ }
using (var sr = new StringReader(reportedCallStack))
{
var match = Regex.Match(frame, frameParserRegex);
Assert.True(match.Success);
Assert.Equal(expectedStackFrame.CallerMemberName, match.Groups["memberName"].Value);
- Assert.Equal(expectedStackFrame.SourceFilePath, match.Groups["filePath"].Value);
- Assert.Equal(expectedStackFrame.SourceLineNumber, Convert.ToInt32(match.Groups["lineNumber"].Value));
+
+ if (PlatformDetection.IsLineNumbersSupported)
+ {
+ Assert.Equal(expectedStackFrame.SourceFilePath, match.Groups["filePath"].Value);
+ Assert.Equal(expectedStackFrame.SourceLineNumber, Convert.ToInt32(match.Groups["lineNumber"].Value));
+ }
}
}
catch