Skip to content

Commit

Permalink
tests: Skip lsp formatting tests when unable nph (#2238)
Browse files Browse the repository at this point in the history
  • Loading branch information
fox0430 authored Feb 7, 2025
1 parent 804dc24 commit 98322a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. _#2238: https://github.com/fox0430/moe/pull/2238

Fixed
.....

- `#2238`_ tests: Skip lsp formatting tests when unable nph

2 changes: 1 addition & 1 deletion tests/tlspclient.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ echo Ojb(n: 1)
check not isTimeout

test "Send textDocument/formatting":
if not isNimlangserverAvailable():
if not isNimlangserverAvailable() or not isNphAvailable():
skip()
else:
const
Expand Down
3 changes: 3 additions & 0 deletions tests/utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ proc resize*(status: var EditorStatus, h, w: int) =
template isNimlangserverAvailable*(): bool =
execCmdEx("nimlangserver --version").exitCode == 0

template isNphAvailable*(): bool =
execCmdEx("nph --v").exitCode == 0

proc removeLineEnd*(buf: string): string =
result = buf
result.stripLineEnd
Expand Down

0 comments on commit 98322a0

Please sign in to comment.