hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit e7dbe3a9bad36fbfe29eb18267df73aa6036c6d5
parent b180c00413c3010e3df0c4353fa2fa77aabc245a
Author: Sebastian <sebastian@sebsite.pw>
Date:   Wed, 23 Feb 2022 15:11:59 -0500

strings: add additional tests for `replace`

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mstrings/replace.ha | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/strings/replace.ha b/strings/replace.ha @@ -29,5 +29,7 @@ export fn replace(s: str, needle: str, target: str) str = { assert(replace("Hello world!", "world", "there") == "Hello there!"); assert(replace("I like dogs, dogs, birds, dogs", "dogs", "cats") == "I like cats, cats, birds, cats"); + assert(replace("aaaaaa", "aa", "a") == "aaa"); + assert(replace("aaaaaa", "a", "aa") == "aaaaaa"); assert(replace("こんにちは", "にち", "ばん") == "こんばんは"); };