hurlfmt failed tests

This commit is contained in:
Fabrice Reix 2023-06-18 14:35:03 +02:00
parent cb0ce3051a
commit 4500ad170a
No known key found for this signature in database
GPG Key ID: BF5213154B2E7155
40 changed files with 85 additions and 85 deletions

View File

@ -12,7 +12,7 @@ hurlfmt --version
# integration tests
cd integration
./hurlfmt_check.sh tests_ok/*.hurl
./hurlfmt_check.sh tests_ok/*.hurl tests_failed/*.hurl
./integration.py
./test_curl_commands.sh
./test_html_output.py tests_ok/*.html tests_failed/*.html

View File

@ -1,7 +1,7 @@
error: Assert failure
--> tests_failed/assert_bytearray.hurl:4:0
|
4 | bytes equals hex,00;
4 | bytes == hex,00;
| actual: byte array <ff>
| expected: byte array <00>
|
@ -9,7 +9,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/assert_bytearray.hurl:5:0
|
5 | sha256 equals hex,a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88;
5 | sha256 == hex,a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88;
| actual: byte array <a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb89>
| expected: byte array <a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88>
|

View File

@ -1,6 +1,6 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-bytearray</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">bytes</span> <span class="predicate-type">equals</span> hex,<span class="hex">00</span>;</span>
<span class="line"><span class="query-type">sha256</span> <span class="predicate-type">equals</span> hex,<span class="hex">a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88</span>;</span>
<span class="line"><span class="query-type">bytes</span> <span class="predicate-type">==</span> hex,<span class="hex">00</span>;</span>
<span class="line"><span class="query-type">sha256</span> <span class="predicate-type">==</span> hex,<span class="hex">a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88</span>;</span>
</span></span></code></pre>

View File

@ -1,5 +1,5 @@
GET http://localhost:8000/error-assert-bytearray
HTTP 200
[Asserts]
bytes equals hex,00;
sha256 equals hex,a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88;
bytes == hex,00;
sha256 == hex,a8100ae6aa1940d0b663bb31cd466142ebbdbd5187131b92d93818987832eb88;

View File

@ -1,7 +1,7 @@
error: Assert failure
--> tests_failed/assert_invalid_predicate_type.hurl:4:0
|
4 | header "content-type" equals 1
4 | header "content-type" == 1
| actual: string <text/html; charset=utf-8>
| expected: int <1>
|

View File

@ -1,6 +1,6 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-invalid-predicate-type</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">equals</span> <span class="number">1</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">==</span> <span class="number">1</span></span>
</span></span><span class="line"></span>
</code></pre>

View File

@ -1,5 +1,5 @@
GET http://localhost:8000/error-assert-invalid-predicate-type
HTTP 200
[Asserts]
header "content-type" equals 1
header "content-type" == 1

View File

@ -1,7 +1,7 @@
error: Assert failure
--> tests_failed/assert_query_cookie.hurl:7:0
|
7 | cookie "cookie1[Secure]" equals false # This is not valid, Secure attribute exists or not but does have a value
7 | cookie "cookie1[Secure]" == false # This is not valid, Secure attribute exists or not but does have a value
| actual: none
| expected: bool <false>
|
@ -9,7 +9,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/assert_query_cookie.hurl:11:0
|
11 | cookie "cookie2[Secure]" equals true # This is not valid, Secure attribute exists or not but does have a value
11 | cookie "cookie2[Secure]" == true # This is not valid, Secure attribute exists or not but does have a value
| actual: unit
| expected: bool <true>
| >>> types between actual and expected are not consistent
@ -18,7 +18,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/assert_query_cookie.hurl:12:0
|
12 | cookie "cookie2[Secure]" not equals true # This is not valid, Secure attribute exists or not but does have a value
12 | cookie "cookie2[Secure]" not == true # This is not valid, Secure attribute exists or not but does have a value
| actual: unit
| expected: not bool <true>
| >>> types between actual and expected are not consistent

View File

@ -4,12 +4,12 @@
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"></span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie1[Secure]"</span> <span class="not">not</span> <span class="predicate-type">exists</span></span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie1[Secure]"</span> <span class="predicate-type">equals</span> <span class="boolean">false</span></span> <span class="comment"># This is not valid, Secure attribute exists or not but does have a value</span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie1[Secure]"</span> <span class="not">not</span> <span class="predicate-type">equals</span> <span class="boolean">true</span></span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie1[Secure]"</span> <span class="predicate-type">==</span> <span class="boolean">false</span></span> <span class="comment"># This is not valid, Secure attribute exists or not but does have a value</span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie1[Secure]"</span> <span class="not">not</span> <span class="predicate-type">==</span> <span class="boolean">true</span></span>
<span class="line"></span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie2[Secure]"</span> <span class="predicate-type">exists</span></span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie2[Secure]"</span> <span class="predicate-type">equals</span> <span class="boolean">true</span></span> <span class="comment"># This is not valid, Secure attribute exists or not but does have a value</span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie2[Secure]"</span> <span class="not">not</span> <span class="predicate-type">equals</span> <span class="boolean">true</span></span> <span class="comment"># This is not valid, Secure attribute exists or not but does have a value</span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie2[Secure]"</span> <span class="predicate-type">==</span> <span class="boolean">true</span></span> <span class="comment"># This is not valid, Secure attribute exists or not but does have a value</span>
<span class="line"><span class="query-type">cookie</span> <span class="string">"cookie2[Secure]"</span> <span class="not">not</span> <span class="predicate-type">==</span> <span class="boolean">true</span></span> <span class="comment"># This is not valid, Secure attribute exists or not but does have a value</span>
</span></span><span class="line"></span>
<span class="line"></span>
<span class="line"></span>

View File

@ -4,12 +4,12 @@ HTTP 200
[Asserts]
cookie "cookie1[Secure]" not exists
cookie "cookie1[Secure]" equals false # This is not valid, Secure attribute exists or not but does have a value
cookie "cookie1[Secure]" not equals true
cookie "cookie1[Secure]" == false # This is not valid, Secure attribute exists or not but does have a value
cookie "cookie1[Secure]" not == true
cookie "cookie2[Secure]" exists
cookie "cookie2[Secure]" equals true # This is not valid, Secure attribute exists or not but does have a value
cookie "cookie2[Secure]" not equals true # This is not valid, Secure attribute exists or not but does have a value
cookie "cookie2[Secure]" == true # This is not valid, Secure attribute exists or not but does have a value
cookie "cookie2[Secure]" not == true # This is not valid, Secure attribute exists or not but does have a value

View File

@ -1,7 +1,7 @@
error: Invalid XPath expression
--> tests_failed/assert_query_invalid_xpath.hurl:4:7
|
4 | xpath "//" equals 1
4 | xpath "//" == 1
| ^^^^ the XPath expression is not valid
|

View File

@ -1,5 +1,5 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/utf8</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"//"</span> <span class="predicate-type">equals</span> <span class="number">1</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"//"</span> <span class="predicate-type">==</span> <span class="number">1</span></span>
</span></span></code></pre>

View File

@ -1,4 +1,4 @@
GET http://localhost:8000/utf8
HTTP 200
[Asserts]
xpath "//" equals 1
xpath "//" == 1

View File

@ -1,7 +1,7 @@
error: Undefined variable
--> tests_failed/assert_template_variable_not_found.hurl:4:33
--> tests_failed/assert_template_variable_not_found.hurl:4:29
|
4 | header "content-type" equals "{{content_type}}"
| ^^^^^^^^^^^^ you must set the variable content_type
4 | header "content-type" == "{{content_type}}"
| ^^^^^^^^^^^^ you must set the variable content_type
|

View File

@ -1,6 +1,6 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-template-variable-not-found</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">equals</span> <span class="string">"{{content_type}}"</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">==</span> <span class="string">"{{content_type}}"</span></span>
</span></span><span class="line"></span>
</code></pre>

View File

@ -1,5 +1,5 @@
GET http://localhost:8000/error-assert-template-variable-not-found
HTTP 200
[Asserts]
header "content-type" equals "{{content_type}}"
header "content-type" == "{{content_type}}"

View File

@ -1 +1 @@
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Undefined variable\n --> tests_failed/assert_template_variable_not_found.hurl:4:33\n |\n 4 | header \"content-type\" equals \"{{content_type}}\"\n | ^^^^^^^^^^^^ you must set the variable content_type\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/assert_template_variable_not_found.hurl","success":false,"time":~~~}
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Undefined variable\n --> tests_failed/assert_template_variable_not_found.hurl:4:29\n |\n 4 | header \"content-type\" == \"{{content_type}}\"\n | ^^^^^^^^^^^^ you must set the variable content_type\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/error-assert-template-variable-not-found"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"0"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/assert_template_variable_not_found.hurl","success":false,"time":~~~}

View File

@ -1,7 +1,7 @@
error: Assert failure
--> tests_failed/assert_value_error.hurl:4:0
|
4 | header "content-type" equals "XXX"
4 | header "content-type" == "XXX"
| actual: string <text/html; charset=utf-8>
| expected: string <XXX>
|
@ -9,7 +9,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/assert_value_error.hurl:5:0
|
5 | header "content-type" notEquals "text/html; charset=utf-8"
5 | header "content-type" != "text/html; charset=utf-8"
| actual: string <text/html; charset=utf-8>
| expected: string <text/html; charset=utf-8>
|
@ -17,7 +17,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/assert_value_error.hurl:6:0
|
6 | jsonpath "$.id" equals "000001"
6 | jsonpath "$.id" == "000001"
| actual: none
| expected: string <000001>
|
@ -42,7 +42,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/assert_value_error.hurl:9:0
|
9 | jsonpath "$.count" greaterThan 5
9 | jsonpath "$.count" > 5
| actual: int <2>
| expected: greater than int <5>
|

View File

@ -1,12 +1,12 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-value</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">equals</span> <span class="string">"XXX"</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">notEquals</span> <span class="string">"text/html; charset=utf-8"</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.id"</span> <span class="predicate-type">equals</span> <span class="string">"000001"</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">==</span> <span class="string">"XXX"</span></span>
<span class="line"><span class="query-type">header</span> <span class="string">"content-type"</span> <span class="predicate-type">!=</span> <span class="string">"text/html; charset=utf-8"</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.id"</span> <span class="predicate-type">==</span> <span class="string">"000001"</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.values"</span> <span class="predicate-type">includes</span> <span class="number">100</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.values"</span> <span class="not">not</span> <span class="predicate-type">contains</span> <span class="string">"Hello"</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">greaterThan</span> <span class="number">5</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">&gt;</span> <span class="number">5</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">isFloat</span></span>
<span class="line"><span class="query-type">bytes</span> <span class="predicate-type">contains</span> hex,<span class="hex">00</span>;</span>
</span></span></code></pre>

View File

@ -1,11 +1,11 @@
GET http://localhost:8000/error-assert-value
HTTP 200
[Asserts]
header "content-type" equals "XXX"
header "content-type" notEquals "text/html; charset=utf-8"
jsonpath "$.id" equals "000001"
header "content-type" == "XXX"
header "content-type" != "text/html; charset=utf-8"
jsonpath "$.id" == "000001"
jsonpath "$.values" includes 100
jsonpath "$.values" not contains "Hello"
jsonpath "$.count" greaterThan 5
jsonpath "$.count" > 5
jsonpath "$.count" isFloat
bytes contains hex,00;

View File

@ -1 +1 @@
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:4:0\n |\n 4 | header \"content-type\" equals \"XXX\"\n | actual: string <text/html; charset=utf-8>\n | expected: string <XXX>\n |","success":false},{"line":5,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:5:0\n |\n 5 | header \"content-type\" notEquals \"text/html; charset=utf-8\"\n | actual: string <text/html; charset=utf-8>\n | expected: string <text/html; charset=utf-8>\n |","success":false},{"line":6,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:6:0\n |\n 6 | jsonpath \"$.id\" equals \"000001\"\n | actual: none\n | expected: string <000001>\n |","success":false},{"line":7,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:7:0\n |\n 7 | jsonpath \"$.values\" includes 100\n | actual: [int <1>, int <2>, int <3>]\n | expected: includes int <100>\n |","success":false},{"line":8,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:8:0\n |\n 8 | jsonpath \"$.values\" not contains \"Hello\"\n | actual: [int <1>, int <2>, int <3>]\n | expected: not contains string <Hello>\n | >>> types between actual and expected are not consistent\n |","success":false},{"line":9,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:9:0\n |\n 9 | jsonpath \"$.count\" greaterThan 5\n | actual: int <2>\n | expected: greater than int <5>\n |","success":false},{"line":10,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:10:0\n |\n10 | jsonpath \"$.count\" isFloat\n | actual: int <2>\n | expected: float\n |","success":false},{"line":11,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:11:0\n |\n11 | bytes contains hex,00;\n | actual: byte array <7b202276616c756573223a205b312c322c335d2c2022636f756e74223a20327d>\n | expected: contains byte array <00>\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/error-assert-value"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"32"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/assert_value_error.hurl","success":false,"time":~~~}
{"cookies":[],"entries":[{"asserts":[{"line":2,"success":true},{"line":2,"success":true},{"line":4,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:4:0\n |\n 4 | header \"content-type\" == \"XXX\"\n | actual: string <text/html; charset=utf-8>\n | expected: string <XXX>\n |","success":false},{"line":5,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:5:0\n |\n 5 | header \"content-type\" != \"text/html; charset=utf-8\"\n | actual: string <text/html; charset=utf-8>\n | expected: string <text/html; charset=utf-8>\n |","success":false},{"line":6,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:6:0\n |\n 6 | jsonpath \"$.id\" == \"000001\"\n | actual: none\n | expected: string <000001>\n |","success":false},{"line":7,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:7:0\n |\n 7 | jsonpath \"$.values\" includes 100\n | actual: [int <1>, int <2>, int <3>]\n | expected: includes int <100>\n |","success":false},{"line":8,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:8:0\n |\n 8 | jsonpath \"$.values\" not contains \"Hello\"\n | actual: [int <1>, int <2>, int <3>]\n | expected: not contains string <Hello>\n | >>> types between actual and expected are not consistent\n |","success":false},{"line":9,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:9:0\n |\n 9 | jsonpath \"$.count\" > 5\n | actual: int <2>\n | expected: greater than int <5>\n |","success":false},{"line":10,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:10:0\n |\n10 | jsonpath \"$.count\" isFloat\n | actual: int <2>\n | expected: float\n |","success":false},{"line":11,"message":"Assert failure\n --> tests_failed/assert_value_error.hurl:11:0\n |\n11 | bytes contains hex,00;\n | actual: byte array <7b202276616c756573223a205b312c322c335d2c2022636f756e74223a20327d>\n | expected: contains byte array <00>\n |","success":false}],"calls":[{"request":{"cookies":[],"headers":[{"name":"Host","value":"localhost:8000"},{"name":"Accept","value":"*/*"},{"name":"User-Agent","value":"hurl/~~~"}],"method":"GET","queryString":[],"url":"http://localhost:8000/error-assert-value"},"response":{"cookies":[],"headers":[{"name":"Server","value":"Werkzeug/~~~ Python/~~~"},{"name":"Date","value":"~~~"},{"name":"Content-Type","value":"text/html; charset=utf-8"},{"name":"Content-Length","value":"32"},{"name":"Server","value":"Flask Server"},{"name":"Connection","value":"close"}],"httpVersion":"HTTP/1.1","status":200},"timings":{"app_connect":~~~,"begin_call":"~~~","connect":~~~,"end_call":"~~~","name_lookup":~~~,"pre_transfer":~~~,"start_transfer":~~~,"total":~~~}}],"captures":[],"index":1,"time":~~~}],"filename":"tests_failed/assert_value_error.hurl","success":false,"time":~~~}

View File

@ -1,22 +1,22 @@
error: Assert failure
--> tests_failed/assert_variable.hurl:8:0
|
8 | variable "toto" equals "tata"
8 | variable "toto" == "tata"
| actual: none
| expected: string <tata>
|
error: Undefined variable
--> tests_failed/assert_variable.hurl:9:28
--> tests_failed/assert_variable.hurl:9:24
|
9 | variable "status" equals {{unknown}}
| ^^^^^^^ you must set the variable unknown
9 | variable "status" == {{unknown}}
| ^^^^^^^ you must set the variable unknown
|
error: Assert failure
--> tests_failed/assert_variable.hurl:10:0
|
10 | variable "status" equals {{type}}
10 | variable "status" == {{type}}
| actual: int <200>
| expected: string <text/html; charset=utf-8>
|
@ -24,7 +24,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/assert_variable.hurl:11:0
|
11 | variable "status" equals {{length}}
11 | variable "status" == {{length}}
| actual: int <200>
| expected: string <0>
|

View File

@ -5,8 +5,8 @@
<span class="line"><span class="name">length</span>: <span class="query-type">header</span> <span class="string">"content-length"</span></span>
<span class="line"><span class="name">type</span>: <span class="query-type">header</span> <span class="string">"content-type"</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">variable</span> <span class="string">"toto"</span> <span class="predicate-type">equals</span> <span class="string">"tata"</span></span>
<span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">equals</span> <span class="expr">{{unknown}}</span></span>
<span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">equals</span> <span class="expr">{{type}}</span></span>
<span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">equals</span> <span class="expr">{{length}}</span></span>
<span class="line"><span class="query-type">variable</span> <span class="string">"toto"</span> <span class="predicate-type">==</span> <span class="string">"tata"</span></span>
<span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">==</span> <span class="expr">{{unknown}}</span></span>
<span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">==</span> <span class="expr">{{type}}</span></span>
<span class="line"><span class="query-type">variable</span> <span class="string">"status"</span> <span class="predicate-type">==</span> <span class="expr">{{length}}</span></span>
</span></span></code></pre>

View File

@ -5,7 +5,7 @@ status: status
length: header "content-length"
type: header "content-type"
[Asserts]
variable "toto" equals "tata"
variable "status" equals {{unknown}}
variable "status" equals {{type}}
variable "status" equals {{length}}
variable "toto" == "tata"
variable "status" == {{unknown}}
variable "status" == {{type}}
variable "status" == {{length}}

View File

@ -1,6 +1,6 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-assert-xpath</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"strong(//head/title)"</span> <span class="predicate-type">equals</span> <span class="string">"Welcome to Quiz!"</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"strong(//head/title)"</span> <span class="predicate-type">==</span> <span class="string">"Welcome to Quiz!"</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"strong(//head/title)"</span> <span class="predicate-type">isEmpty</span></span>
</span></span></code></pre>

View File

@ -1,5 +1,5 @@
GET http://localhost:8000/error-assert-xpath
HTTP 200
[Asserts]
xpath "strong(//head/title)" equals "Welcome to Quiz!"
xpath "strong(//head/title)" == "Welcome to Quiz!"
xpath "strong(//head/title)" isEmpty

View File

@ -18,7 +18,7 @@ error: Assert header value
error: Assert failure
--> tests_failed/error_format_long.hurl:5:0
|
5 | xpath "string(//head/title)" equals "Welcome!"
5 | xpath "string(//head/title)" == "Welcome!"
| actual: string <Test>
| expected: string <Welcome!>
|

View File

@ -2,7 +2,7 @@
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="string">Content-Type</span>: <span class="string">text/html</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"string(//head/title)"</span> <span class="predicate-type">equals</span> <span class="string">"Welcome!"</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"string(//head/title)"</span> <span class="predicate-type">==</span> <span class="string">"Welcome!"</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"//foo"</span> <span class="predicate-type">isEmpty</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"//title"</span> <span class="filter-type">count</span> <span class="predicate-type">==</span> <span class="number">2</span></span>
</span></span></code></pre>

View File

@ -2,6 +2,6 @@ GET http://localhost:8000/error-assert-xpath
HTTP 200
Content-Type: text/html
[Asserts]
xpath "string(//head/title)" equals "Welcome!"
xpath "string(//head/title)" == "Welcome!"
xpath "//foo" isEmpty
xpath "//title" count == 2

View File

@ -5,4 +5,4 @@ jsonpath "$.id" toInt == 123
jsonpath "$.status" toInt == 0
jsonpath "$.unknown" toInt == 1
jsonpath "$.list" nth 5 == 3
jsonpath "$.id" toDate "%a, %d %b %Y %H:%M:%S GMT" == "unused"
jsonpath "$.id" toDate "%a, %d %b %Y %H:%M:%S GMT" == "unused"

View File

@ -5,4 +5,4 @@ HTTP 200
bytes decode "utf-8" == "café" # value is decoded with success
bytes decode "unknown" == "café" # <unknown> encoding is not supported
bytes decode "arabic" == "café" # value can not be decoded with <arabic> encoding
bytes decode "iso-8859-1" == "café" # value can be decoded but to an invalid string café
bytes decode "iso-8859-1" == "café" # value can be decoded but to an invalid string café

View File

@ -1,7 +1,7 @@
error: Invalid JSONPath
--> tests_failed/invalid_jsonpath.hurl:4:10
|
4 | jsonpath "" equals false
4 | jsonpath "" == false
| ^^ the JSONPath expression '' is not valid
|

View File

@ -1,5 +1,5 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-invalid-jsonpath</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">""</span> <span class="predicate-type">equals</span> <span class="boolean">false</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">""</span> <span class="predicate-type">==</span> <span class="boolean">false</span></span>
</span></span></code></pre>

View File

@ -1,4 +1,4 @@
GET http://localhost:8000/error-invalid-jsonpath
HTTP 200
[Asserts]
jsonpath "" equals false
jsonpath "" == false

View File

@ -1,7 +1,7 @@
error: Invalid XML
--> tests_failed/invalid_xml.hurl:4:1
|
4 | xpath "xx" equals 1
4 | xpath "xx" == 1
| ^^^^^^^^^^ the HTTP response is not a valid XML
|

View File

@ -1,5 +1,5 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/error-invalid-xml</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"xx"</span> <span class="predicate-type">equals</span> <span class="number">1</span></span>
<span class="line"><span class="query-type">xpath</span> <span class="string">"xx"</span> <span class="predicate-type">==</span> <span class="number">1</span></span>
</span></span></code></pre>

View File

@ -1,4 +1,4 @@
GET http://localhost:8000/error-invalid-xml
HTTP 200
[Asserts]
xpath "xx" equals 1
xpath "xx" == 1

View File

@ -1,7 +1,7 @@
error: Assert failure
--> tests_failed/predicate.hurl:4:0
|
4 | jsonpath "$.status" equals "true"
4 | jsonpath "$.status" == "true"
| actual: bool <true>
| expected: string <true>
|
@ -9,7 +9,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/predicate.hurl:6:0
|
6 | jsonpath "$.count" equals 0
6 | jsonpath "$.count" == 0
| actual: int <1>
| expected: int <0>
|
@ -17,7 +17,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/predicate.hurl:7:0
|
7 | jsonpath "$.message" equals 0
7 | jsonpath "$.message" == 0
| actual: string <0>
| expected: int <0>
|
@ -25,7 +25,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/predicate.hurl:8:0
|
8 | jsonpath "$.empty" equals 0
8 | jsonpath "$.empty" == 0
| actual: string <>
| expected: int <0>
|
@ -33,7 +33,7 @@ error: Assert failure
error: Assert failure
--> tests_failed/predicate.hurl:9:0
|
9 | jsonpath "$.number" equals 1.1
9 | jsonpath "$.number" == 1.1
| actual: float <1.0>
| expected: float <1.1>
|

View File

@ -1,12 +1,12 @@
<pre><code class="language-hurl"><span class="hurl-entry"><span class="request"><span class="line"><span class="method">GET</span> <span class="url">http://localhost:8000/predicate/error/type</span></span>
</span><span class="response"><span class="line"><span class="version">HTTP</span> <span class="number">200</span></span>
<span class="line"><span class="section-header">[Asserts]</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.status"</span> <span class="predicate-type">equals</span> <span class="string">"true"</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.status"</span> <span class="predicate-type">==</span> <span class="string">"true"</span></span>
<span class="line"></span><span class="comment">#jsonpath "$.count" equals "0"</span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">equals</span> <span class="number">0</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">equals</span> <span class="number">0</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.empty"</span> <span class="predicate-type">equals</span> <span class="number">0</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.number"</span> <span class="predicate-type">equals</span> <span class="number">1.1</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.count"</span> <span class="predicate-type">==</span> <span class="number">0</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">==</span> <span class="number">0</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.empty"</span> <span class="predicate-type">==</span> <span class="number">0</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.number"</span> <span class="predicate-type">==</span> <span class="number">1.1</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">startsWith</span> <span class="string">"hi"</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">endsWith</span> <span class="string">"hi"</span></span>
<span class="line"><span class="query-type">jsonpath</span> <span class="string">"$.message"</span> <span class="predicate-type">contains</span> <span class="string">"hi"</span></span>

View File

@ -1,12 +1,12 @@
GET http://localhost:8000/predicate/error/type
HTTP 200
[Asserts]
jsonpath "$.status" equals "true"
jsonpath "$.status" == "true"
#jsonpath "$.count" equals "0"
jsonpath "$.count" equals 0
jsonpath "$.message" equals 0
jsonpath "$.empty" equals 0
jsonpath "$.number" equals 1.1
jsonpath "$.count" == 0
jsonpath "$.message" == 0
jsonpath "$.empty" == 0
jsonpath "$.number" == 1.1
jsonpath "$.message" startsWith "hi"
jsonpath "$.message" endsWith "hi"
jsonpath "$.message" contains "hi"