Update doc diff

This commit is contained in:
Fabrice Reix 2024-06-06 15:54:31 +02:00 committed by hurl-bot
parent b74ddf49fa
commit d75d2424a8
No known key found for this signature in database
GPG Key ID: 1283A2B4A0DCAF8D

View File

@ -98,15 +98,14 @@ A diff output (similar to git diff) could be used instead to display the error.
```
error: Assert body value
--> test.hurl:4:1
--> test.hurl:8:1
|
| GET http://localhost:8000/test
| ...
4 | @@ -2,7 +2,7 @@
| "first_name": "John",
| "last_name": "Smith",
| "is_alive": true,
| - "age": 27,
8 | - "age": 27,
| + "age": 28,
| "address": {
| "street_address": "21 2nd Street",
@ -130,8 +129,7 @@ error: Assert body value
|
| GET http://localhost:8000/test
| ...
4 | @@ -1 +1 @@
| -Hello World!
4 | -Hello World!
| +Hi World!
|
```
@ -145,6 +143,146 @@ The color is necessary here to see the additional whitespace.
We could also add a cli option to show explicitly "invisible characters".
### Display more or less context lines before first change
## Change at line 1
Standard unified diff
```
@@ -1,4 +1,4 @@
-{
+[
"first_name": "John",
"last_name": "Smith",
"is_alive": true,
```
Hurl Output
```
error: Assert body value
--> test.hurl:4:1
|
| GET http://localhost:8000/test
4 | -{
| +[
| "first_name": "John",
| "last_name": "Smith",
| "is_alive": true,
```
## Change at line 2
Standard unified diff
```
@@ -1,5 +1,5 @@
{
- "first_name": "John",
+ "first_name": "Bob",
"last_name": "Smith",
"is_alive": true,
"age": 27,
```
Hurl Output
```
error: Assert body value
--> test.hurl:5:1
|
| GET http://localhost:8000/test
| {
5 |- "first_name": "John",
|+ "first_name": "Bob",
| "is_alive": true,
| "age": 27,
```
## Change at line 3
Standard unified diff
```
@@ -1,6 +1,6 @@
{
"first_name": "John",
- "last_name": "Smith",
+ "last_name": "Smiths",
"is_alive": true,
"age": 27,
"address": {
```
Hurl Output
```
error: Assert body value
--> test.hurl:6:1
|
| GET http://localhost:8000/test
| {
| "first_name": "John",
6 |- "last_name": "Smith",
|+ "last_name": "Smiths",
| "is_alive": true,
| "age": 27,
| "address": {
```
### Display several diff Hunks
Standard Unified Diff
```
@@ -2,7 +2,7 @@
"first_name": "John",
"last_name": "Smith",
"is_alive": true,
- "age": 27,
+ "age": 28,
"address": {
"street_address": "21 2nd Street",
"city": "New York",
@@ -22,7 +22,7 @@
"children": [
"Catherine",
"Thomas",
- "Trevor"
+ "Bob"
],
"spouse": null
}
```
```
error: Assert body value
--> test.hurl:8:1
|
| GET http://localhost:8000/test
| ...
| "first_name": "John",
|- "last_name": "Smith",
| "is_alive": true,
8 |- "age": 27,
|+ "age": 28,
| "address": {
| "street_address": "21 2nd Street",
| "city": "New York",
| ...
| "children": [
| "Catherine",
| "Thomas",
28 |- "Trevor"
|+ "Bob"
| ],
| "spouse": null
| }
```