u-boot/test
Massimiliano Minella 4c73630686 cmd: setexpr: fix no matching string in gsub return empty value
In gsub, when the destination string is empty, the string 't' is
provided and the regular expression doesn't match, then the final result
is an empty string.

Example:

=> echo ${foo}

=> setenv foo
=> setexpr foo gsub e a bar
=> echo ${foo}

=>

The variable ${foo} should contain "bar" and the lack of match shouldn't
be considered an error.

This patch fixes the erroneous behavior by removing the return
statement and breaking out of the loop in case of lack of match.

Also add a test for the no match case.

Signed-off-by: Massimiliano Minella <massimiliano.minella@se.com>
2024-03-02 12:26:19 -05:00
..
boot efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGR 2024-01-17 08:40:25 +01:00
cmd cmd: setexpr: fix no matching string in gsub return empty value 2024-03-02 12:26:19 -05:00
common test: event: Only run test_event_probe() on sandbox 2023-12-13 18:39:05 -05:00
dm clk: Remove rfree 2024-01-29 22:35:02 -05:00
env sandbox: add test of CONFIG_ENV_IMPORT_FDT 2021-05-04 12:52:30 -04:00
fs test: fs: fs-test: Move the tests to use sha256sum 2024-01-11 21:19:25 -05:00
fuzz cmd: Convert existing long help messages to the new macro 2023-10-16 10:24:58 -04:00
hush Revert "test: hush: dollar: fix bugous behavior" 2024-01-18 11:38:25 -05:00
image Merge patch series "fs: fat: calculate FAT type based on cluster count" 2023-11-28 20:10:36 -05:00
lib test: lmb: Move tests into the lib suite 2023-12-13 18:39:05 -05:00
log log: Remove some places where we redefine LOGLEVEL 2022-12-23 10:07:03 -05:00
optee test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
overlay test: Add a macros for finding tests in linker_lists 2021-03-12 09:57:30 -05:00
py test/py: net: Add dhcp abort test 2024-03-01 18:34:08 -05:00
stdint Remove <inttypes.h> includes and PRI* usages in printf() entirely 2018-09-10 20:48:17 -04:00
trace SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bloblist.c bloblist: refactor of bloblist_reloc() 2024-02-29 09:24:22 -05:00
bootm.c test: Fix bootm_test_subst_var() running independently 2022-09-12 18:06:36 -04:00
cmd_ut.c test: Add framework to test hush behavior 2023-12-28 12:02:56 -05:00
command_ut.c unit-test: cover run_commandf() by test-cases 2023-03-30 15:09:59 -04:00
common.sh Consistently use nproc for counting the CPUs 2020-01-30 13:30:35 -05:00
compression.c test: compression: add zstd uncompression test 2023-01-18 19:41:15 -05:00
Kconfig test: CONFIG_UT_BOOTSTD must depend on CONFIG_BOOTSTD 2024-01-11 21:19:25 -05:00
Makefile test: build test/boot for CONFIG_UT_BOOTSTD=n 2024-01-11 21:19:25 -05:00
print_ut.c test: print: Skip test on x86 2023-12-13 18:39:05 -05:00
run test: Run the VPL tests with 'make check' 2023-04-03 06:53:53 +12:00
str_ut.c lib: Add a function to split a string into substrings 2023-01-23 18:11:39 -05:00
test-main.c spl: Allow enabling SPL_OF_REAL and SPL_OF_PLATDATA at the same time 2023-10-17 20:50:52 -04:00
time_ut.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
unicode_ut.c test: enhance unicode_test_utf8_to_utf32_stream() 2024-01-24 16:17:14 -05:00
ut.c test: Add helper to skip to partial console line 2023-12-13 18:39:05 -05:00