From 7901bfb25809599da10c21421842206b621b886a Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Sat, 26 Apr 2025 12:37:54 -0400 Subject: [PATCH] print out the thing we looked up, too --- src/lib/unlang/xlat_builtin.c | 4 ++-- src/tests/keywords/if-failed-xlat | 2 +- src/tests/keywords/if-regex-match-named | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index cea9238859..42c5776b1e 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -2848,7 +2848,7 @@ static xlat_action_t xlat_func_regex(TALLOC_CTX *ctx, fr_dcursor_t *out, MEM(vb = fr_value_box_alloc_null(ctx)); if (regex_request_to_sub(vb, vb, request, idx.vb_uint32) < 0) { - REDEBUG2("No previous numbered regex capture group"); + REDEBUG2("No previous numbered regex capture group '%u'", idx.vb_uint32); talloc_free(vb); return XLAT_ACTION_FAIL; } @@ -2874,7 +2874,7 @@ static xlat_action_t xlat_func_regex(TALLOC_CTX *ctx, fr_dcursor_t *out, MEM(vb = fr_value_box_alloc_null(ctx)); if (regex_request_to_sub_named(vb, vb, request, arg->vb_strvalue) < 0) { - REDEBUG2("No previous named regex capture group"); + REDEBUG2("No previous named regex capture group '%s'", arg->vb_strvalue); talloc_free(vb); return XLAT_ACTION_FAIL; } diff --git a/src/tests/keywords/if-failed-xlat b/src/tests/keywords/if-failed-xlat index 79b70d84c9..420b55d9bf 100644 --- a/src/tests/keywords/if-failed-xlat +++ b/src/tests/keywords/if-failed-xlat @@ -10,7 +10,7 @@ if (%regex('foo')) { test_fail } -if (!(Module-Failure-Message[*] == "No previous named regex capture group")) { +if (Module-Failure-Message[*] != "No previous named regex capture group 'foo'") { test_fail } } diff --git a/src/tests/keywords/if-regex-match-named b/src/tests/keywords/if-regex-match-named index 52f25137d1..714f4e8f8a 100644 --- a/src/tests/keywords/if-regex-match-named +++ b/src/tests/keywords/if-regex-match-named @@ -25,7 +25,7 @@ if (%regex('foo')) { test_fail } -if (!(Module-Failure-Message[*] == "No previous named regex capture group")) { +if (!(Module-Failure-Message[*] == "No previous named regex capture group 'foo'")) { test_fail } @@ -36,7 +36,7 @@ if (%regex(Port-Limit)) { test_fail } -if (!(Module-Failure-Message[*] == "No previous numbered regex capture group")) { +if (!(Module-Failure-Message[*] == "No previous numbered regex capture group '1'")) { test_fail } -- 2.47.3