Add early returns for empty entries.

This commit is contained in:
Jean-Christophe Amiel 2025-10-26 20:13:57 +01:00
parent acd85a5876
commit 4402afceaf
No known key found for this signature in database
GPG Key ID: 07FF11CFD55356CC
3 changed files with 11 additions and 2 deletions

View File

@ -1,4 +1,4 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'
hurl --color --verbose tests_ok/color/color.hurl
hurl --color --verbose tests_ok/color/color.hurl

View File

@ -1,4 +1,4 @@
#!/bin/bash
set -Eeuo pipefail
hurl --color --verbose tests_ok/color/color.hurl
hurl --color --verbose tests_ok/color/color.hurl

View File

@ -153,6 +153,15 @@ pub fn run_entries(
listener: Option<&dyn EventListener>,
logger: &mut Logger,
) -> HurlResult {
// Early returns for empty entries.
if entries.is_empty() {
return HurlResult {
success: true,
variables: variables.clone(),
..Default::default()
};
}
let mut http_client = Client::new();
let mut entries_result = vec![];
let mut variables = variables.clone();