From 8e1ef21150f35d66e34d10e8b365549a569c4e84 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sun, 31 Aug 2025 01:48:13 +0900 Subject: [PATCH] added a couple of test cases for gensub --- t/h-002.hawk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t/h-002.hawk b/t/h-002.hawk index 2f0d50af..e070d63f 100644 --- a/t/h-002.hawk +++ b/t/h-002.hawk @@ -218,6 +218,10 @@ function main() tap_ensure (x, "the tiger-tiger pounces on the dog", @SCRIPTNAME, @SCRIPTLINE); x = gensub(/(tiger|dog)/, "\\1-\\1", 10, "the tiger pounces on the dog"); tap_ensure (x, "the tiger pounces on the dog", @SCRIPTNAME, @SCRIPTLINE); + x = gensub(/(tiger|(dog))/, "\\1-\\2", 'g', "the tiger pounces on the dog"); + tap_ensure (x, "the tiger- pounces on the dog-dog", @SCRIPTNAME, @SCRIPTLINE); + x = gensub(/(tiger|(dog))/, "[&]", 'g', "the tiger pounces on the dog"); + tap_ensure (x, "the [tiger] pounces on the [dog]", @SCRIPTNAME, @SCRIPTLINE); } {