Skip to content

Commit 5fb531d

Browse files
authored
test(Str): add testWrapEdgeCases covering wrap edge scenarios (#57861)
1 parent 2849cd6 commit 5fb531d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Support/SupportStrTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,17 @@ public function testWrap()
560560
$this->assertEquals('foo-bar-baz', Str::wrap('-bar-', 'foo', 'baz'));
561561
}
562562

563+
public function testWrapEdgeCases()
564+
{
565+
$this->assertSame('[]mid[]', Str::wrap('mid', '[]'));
566+
$this->assertSame('(mid', Str::wrap('mid', '(', ''));
567+
$this->assertSame('<mid<', Str::wrap('mid', '<'));
568+
$this->assertSame('value', Str::wrap('value', ''));
569+
$this->assertSame('[][]', Str::wrap('', '[]'));
570+
$this->assertSame('«値»', Str::wrap('', '«', '»'));
571+
$this->assertSame('🧪X🧪', Str::wrap('X', '🧪'));
572+
}
573+
563574
public function testUnwrap()
564575
{
565576
$this->assertEquals('value', Str::unwrap('"value"', '"'));

0 commit comments

Comments
 (0)