Skip to content

Commit

Permalink
Cross-Platformify Document Point Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iwillspeak committed Jun 17, 2024
1 parent 13d4cf2 commit 61bdb25
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
22 changes: 0 additions & 22 deletions test/Feersum.Tests/SyntaxShimTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,6 @@ module private Utils =
sanitiseNodeWith (function
| _ -> dummyLocation)

// let readExpr source =
// let doc = TextDocument.fromParts "repl" source

// let tree =
// readProgram doc.Path source |> ParseResult.map (SyntaxShim.transformProgram doc)

// (tree.Root, tree.Diagnostics)

// /// Read a single expression node from the input string
// let public readSingleNode input =
// match readExpr input with
// | ({ Kind = Seq exprs }, []) -> (List.exactlyOne exprs)
// | (expr, []) -> expr
// | (_, diag) -> failwithf "Expected single expression but got: %A" diag

// /// Helper to read a single AST kind from the given `input`
// let public readSingle input = (readSingleNode input).Kind

// let public readMany input =
// match readExpr input with
// | (read, []) -> read
// | (_, diag) -> failwithf "Expected one or more expressions but got: %A" diag

[<Fact>]
let ``syntax shim test`` () =
Expand Down
2 changes: 1 addition & 1 deletion test/Feersum.Tests/TextTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ let ``text document points`` () =

c (1, 1) 0
c (6, 1) (body.LastIndexOf("990"))
c (7, 1) (body.LastIndexOf("0") + 2)
c (7, 1) (body.Length)
c (2, 2) (body.IndexOf("let"))
c (4, 10) (body.IndexOf("lines and comments"))

0 comments on commit 61bdb25

Please sign in to comment.