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

Invalid Source Line in diff error message when using variable with newline #3946

Open
fabricereix opened this issue Apr 4, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@fabricereix
Copy link
Collaborator

The following textual response

line1
line2
line3
line4

can be tested with the multiline body in Hurl.:

1     GET http://localhost:8000/test
2     HTTP 200
3    ```
4    line1
5    line2
6    line3
7    line4
8    ```

If LINE4 is returned by the server (instead of line4), we have the following error message (as expected):

    --> test.hurl:5:1
    |
    | GET http://localhost:8000/test
    | ...
  7 | line4
    |   -line4
    |   +LINE4
    |

The invalid source line can occur when the expected body contains variables with newline value.
For example:

1  GET http://localhost:8000/test
2  [Options]
3  variable: newline=\n
4  HTTP 200
5  ```
6  line1
7  line2{{newline}}line3
8  line4
9  ```

The error has now an invalid source line:

  --> /tmp/test.hurl:9:1
  |
  | GET http://localhost:8000/test
  | ...
9 | ```
  |   -line4
  |   +LINE4
  |

```
@fabricereix fabricereix added the bug Something isn't working label Apr 4, 2025
@fabricereix
Copy link
Collaborator Author

The challenge here is to keep original source information. We may have to introduce a kind of source map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant