-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(uri): add an e2e test for uri #771
Conversation
`); | ||
const params = await receivedDiganostics; | ||
|
||
expect(params.uri).toBe(uri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fails with:
Expected: "file:///src/n%C3%A9w/M%C3%B6del%20%2B%20Other%20Th%C3%AEng%C3%9F/test.ml"
Received: "file:///src/n%C3%A9w/M%C3%B6del %2B Other Th%C3%AEng%C3%9F/test.ml"
#739 should fix it but I'm not sure if we really need an e2e test for that since we already have OCaml tests for the URI parsing?
Signed-off-by: Rudi Grinberg <[email protected]> ps-id: ff9fc51c-ce4b-4c1d-852a-2a86c4b7d4aa
in | ||
let run = | ||
let* (_ : InitializeResult.t) = Client.initialized client in | ||
let uri = DocumentUri.of_path "src/néw/Mödel + Other Thîngß/test.ml" in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it represents what happens in reality because our DocumentUri.of_path
implementation isn't correct so the URI string that will be sent to the server is already "broken".
What happens in real is that VSCode sends a valid URI string, and the server returns an incorrect one (due to an incorrect parsing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said, I'm not sure that an e2e test is useful for that. We already have unit tests for the URI parsing.
Please re-open if this still relevant |
This adds an e2e test to demonstrate that paths with special characters (space, accents, ...) are not well handled. I used a
DidOpenTextDocumentNotification
but it doesn't matter, any request/notification that sends auri
will have the same issue.