From 0768ec837101f52da3f6beb812238a881389ed0b Mon Sep 17 00:00:00 2001 From: Fabrice Reix Date: Sat, 29 Jun 2024 08:37:48 +0200 Subject: [PATCH] Add test with a tab in expected body --- integration/hurl/tests_ok/junit.err.pattern | 17 +++++++++++++++++ integration/hurl/tests_ok/junit.out.pattern | 9 ++++++++- integration/hurl/tests_ok/junit.ps1 | 2 ++ integration/hurl/tests_ok/junit.sh | 1 + integration/hurl/tests_ok/test.4.hurl | 3 +++ integration/hurl/tests_ok/test.err.pattern | 18 ++++++++++++++---- 6 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 integration/hurl/tests_ok/test.4.hurl diff --git a/integration/hurl/tests_ok/junit.err.pattern b/integration/hurl/tests_ok/junit.err.pattern index 3055fdf59..54e1c6f42 100755 --- a/integration/hurl/tests_ok/junit.err.pattern +++ b/integration/hurl/tests_ok/junit.err.pattern @@ -24,3 +24,20 @@ Succeeded files: 1 (100.0%) Failed files: 0 (0.0%) Duration: <<<\d+>>> ms +error: Assert body value + --> tests_ok/test.4.hurl:3:1 + | + | GET http://localhost:8000/hello + | ... + 3 | `Hello\tWorld!` + | ^^^^^^^^^^^^^^^ actual value is + | + +tests_ok/test.4.hurl: Failure (1 request(s) in <<<\d+>>> ms) +-------------------------------------------------------------------------------- +Executed files: 1 +Executed requests: 1 (<<<.*?>>>/s) +Succeeded files: 0 (0.0%) +Failed files: 1 (100.0%) +Duration: <<<\d+>>> ms + diff --git a/integration/hurl/tests_ok/junit.out.pattern b/integration/hurl/tests_ok/junit.out.pattern index c57490f9d..75c3f7f8f 100644 --- a/integration/hurl/tests_ok/junit.out.pattern +++ b/integration/hurl/tests_ok/junit.out.pattern @@ -5,4 +5,11 @@ | ... 8 | `Goodbye World!` | ^^^^^^^^^^^^^^^^ actual value is <Hello World!> - | \ No newline at end of file + |Assert body value + --> tests_ok/test.4.hurl:3:1 + | + | GET http://localhost:8000/hello + | ... + 3 | `Hello\tWorld!` + | ^^^^^^^^^^^^^^^ actual value is <Hello World!> + | \ No newline at end of file diff --git a/integration/hurl/tests_ok/junit.ps1 b/integration/hurl/tests_ok/junit.ps1 index 068f78013..f591ac4a7 100644 --- a/integration/hurl/tests_ok/junit.ps1 +++ b/integration/hurl/tests_ok/junit.ps1 @@ -9,6 +9,8 @@ $ErrorActionPreference = 'Continue' # We use --jobs 1 to force the standard error order to be test1 then test2. hurl --test --jobs 1 --report-junit build/junit/result.xml tests_ok/test.1.hurl tests_ok/test.2.hurl hurl --test --report-junit build/junit/result.xml tests_ok/test.3.hurl +# TBC: using || true versus $ErrorActionPreference = 'Continue' +hurl --test --report-junit build/junit/result.xml tests_ok/test.4.hurl || true $ErrorActionPreference = 'Stop' Write-Host (Get-Content build/junit/result.xml -Raw) -NoNewLine diff --git a/integration/hurl/tests_ok/junit.sh b/integration/hurl/tests_ok/junit.sh index 7d65ca173..e7dc8594d 100755 --- a/integration/hurl/tests_ok/junit.sh +++ b/integration/hurl/tests_ok/junit.sh @@ -7,6 +7,7 @@ set +eo pipefail # We use --jobs 1 to force the standard error order to be test1 then test2. hurl --test --jobs 1 --report-junit build/junit/result.xml tests_ok/test.1.hurl tests_ok/test.2.hurl hurl --test --report-junit build/junit/result.xml tests_ok/test.3.hurl +hurl --test --report-junit build/junit/result.xml tests_ok/test.4.hurl set -Eeuo pipefail cat build/junit/result.xml diff --git a/integration/hurl/tests_ok/test.4.hurl b/integration/hurl/tests_ok/test.4.hurl new file mode 100644 index 000000000..35d8c7bc3 --- /dev/null +++ b/integration/hurl/tests_ok/test.4.hurl @@ -0,0 +1,3 @@ +GET http://localhost:8000/hello +HTTP 200 +`Hello\tWorld!` diff --git a/integration/hurl/tests_ok/test.err.pattern b/integration/hurl/tests_ok/test.err.pattern index 2407a2680..4709b2f3c 100644 --- a/integration/hurl/tests_ok/test.err.pattern +++ b/integration/hurl/tests_ok/test.err.pattern @@ -10,10 +10,20 @@ error: Assert body value tests_ok<<<.*?>>>test.2.hurl: Failure (2 request(s) in <<<\d+>>> ms) tests_ok<<<.*?>>>test.3.hurl: Success (1 request(s) in <<<\d+>>> ms) +error: Assert body value + --> tests_ok<<<.*?>>>test.4.hurl:3:1 + | + | GET http://localhost:8000/hello + | ... + 3 | `Hello\tWorld!` + | ^^^^^^^^^^^^^^^ actual value is + | + +tests_ok<<<.*?>>>test.4.hurl: Failure (1 request(s) in <<<\d+>>> ms) -------------------------------------------------------------------------------- -Executed files: 3 -Executed requests: 4 (<<<.*?>>>/s) -Succeeded files: 2 (66.7%) -Failed files: 1 (33.3%) +Executed files: 4 +Executed requests: 5 (<<<.*?>>>/s) +Succeeded files: 2 (50.0%) +Failed files: 2 (50.0%) Duration: <<<\d+>>> ms