mirror of
https://github.com/Smaug123/WoofWare.Expect
synced 2025-10-05 20:48:40 +00:00
Better error message on failure to find keyword (#29)
This commit is contained in:
@@ -205,9 +205,15 @@ module internal AstWalker =
|
|||||||
| ParsedInput.SigFile _ -> failwith "unexpected: signature files can't contain expressions"
|
| ParsedInput.SigFile _ -> failwith "unexpected: signature files can't contain expressions"
|
||||||
|
|
||||||
// Find the closest match
|
// Find the closest match
|
||||||
results
|
let matches =
|
||||||
|> Seq.filter (fun loc ->
|
results
|
||||||
loc.KeywordRange.StartLine <= lineNumber
|
|> List.filter (fun loc ->
|
||||||
&& lineNumber <= loc.KeywordRange.EndLine
|
loc.KeywordRange.StartLine <= lineNumber
|
||||||
)
|
&& lineNumber <= loc.KeywordRange.EndLine
|
||||||
|> Seq.exactlyOne
|
)
|
||||||
|
|
||||||
|
match matches with
|
||||||
|
| [] ->
|
||||||
|
failwith
|
||||||
|
$"Unexpectedly failed to locate snapshot keyword %s{methodName} at line %i{lineNumber} of file %s{infoFilePath}. Please report this along with the contents of the file."
|
||||||
|
| m :: _ -> m
|
||||||
|
Reference in New Issue
Block a user