From 52571fc705a5fd57536dede82171cfa00b8d4e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borys=20=C5=BBmuda?= Date: Sun, 13 Oct 2024 10:35:17 +0200 Subject: [PATCH] test: Adds test for quantifier times equal zero --- tests/Unit/QuantifiersTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Unit/QuantifiersTest.php b/tests/Unit/QuantifiersTest.php index bbc96b6..0cdc84b 100644 --- a/tests/Unit/QuantifiersTest.php +++ b/tests/Unit/QuantifiersTest.php @@ -23,6 +23,13 @@ ->toBe('/\w+/'); }); +it('can add zero `times` quantifier causes token to be ignored', function () { + $regex = fluentBuilder()->word()->times(0); + + expect($regex->get()) + ->toBe('/\w{0}/'); +}); + it('can add `times` quantifier', function () { $regex = fluentBuilder()->word()->times(1);