Skip to content
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

Closed
wants to merge 3 commits into from
Closed

Conversation

tatchi
Copy link
Collaborator

@tatchi tatchi commented Jul 4, 2022

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 a uri will have the same issue.

`);
const params = await receivedDiganostics;

expect(params.uri).toBe(uri);
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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).

Copy link
Collaborator Author

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.

@rgrinberg
Copy link
Member

Please re-open if this still relevant

@rgrinberg rgrinberg closed this Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants