added a couple of test cases for gensub
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-08-31 01:48:13 +09:00
parent 0f59ab4a94
commit 8e1ef21150

View File

@ -218,6 +218,10 @@ function main()
tap_ensure (x, "the tiger-tiger pounces on the dog", @SCRIPTNAME, @SCRIPTLINE); 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"); x = gensub(/(tiger|dog)/, "\\1-\\1", 10, "the tiger pounces on the dog");
tap_ensure (x, "the tiger pounces on the dog", @SCRIPTNAME, @SCRIPTLINE); 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);
} }
{ {