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

Small error display for failed assert output on Hurl 2.0.0 #1175

Closed
jcamiel opened this issue Jan 17, 2023 · 1 comment · Fixed by #2617
Closed

Small error display for failed assert output on Hurl 2.0.0 #1175

jcamiel opened this issue Jan 17, 2023 · 1 comment · Fixed by #2617
Labels
bug Something isn't working

Comments

@jcamiel
Copy link
Collaborator

jcamiel commented Jan 17, 2023

Summary

Small error in Hurl error ouput on Hurl 2.0.0

Steps to reproduce

Given the following Hurl files:

GET https://csvbase.com/meripaterson/stock-exchanges
HTTP 200
[Captures]
lines: body split "\n"
australia: variable "lines" nth 7 split ","
[Asserts]
variable "australia"  == "Australia & Oceania"

(correct Hurl file should be variable "australia" nth 1 == "Australia & Oceania"
The errors displayed is :

error: Assert failure
  --> /tmp/csv.hurl:7:0
   |
 7 | variable "australia"  == "Australia & Oceania"
   |   actual:   [string <7>, string <Australia & Oceania>, string <Australia>, string <Chi-X Australia>, string <CHIA>, string <2018-04-02
>]
   |   expected: string <Australia & Oceania>
   |

bug

@jcamiel jcamiel added the bug Something isn't working label Jan 17, 2023
@fabricereix fabricereix added this to the 2.1.0 milestone Jan 25, 2023
@jcamiel jcamiel removed this from the 3.0.0 milestone May 3, 2023
@jcamiel
Copy link
Collaborator Author

jcamiel commented Jan 25, 2024

The bug can be reproduced because the response body is a CRLF text file.
When we split:

lines: body split "\n"

We have a list of CR lines. When we display one of this CR line, the terminal cursor goes back to the begining of the current line.

With this capture:

lines: body split "\r\n"

We don't have the bug.

@fabricereix : maybe when we render a value (actual vs expected), we should replace real \n \r with "visible" chars.

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

Successfully merging a pull request may close this issue.

2 participants