Skip to content

Commit ec30b5e

Browse files
committed
add more tests
1 parent 2488eba commit ec30b5e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/Support/SupportStrTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,15 @@ public function testStrBeforeLast()
129129

130130
public function testStrBetween()
131131
{
132+
$this->assertSame('abc', Str::between('abc', '', 'c'));
133+
$this->assertSame('abc', Str::between('abc', 'a', ''));
134+
$this->assertSame('abc', Str::between('abc', '', ''));
135+
$this->assertSame('b', Str::between('abc', 'a', 'c'));
136+
$this->assertSame('b', Str::between('dddabc', 'a', 'c'));
137+
$this->assertSame('b', Str::between('abcddd', 'a', 'c'));
138+
$this->assertSame('b', Str::between('dddabcddd', 'a', 'c'));
132139
$this->assertSame('nn', Str::between('hannah', 'ha', 'ah'));
140+
$this->assertSame('a]ab[b', Str::between('[a]ab[b]', '[', ']'));
133141
$this->assertSame('foo', Str::between('foofoobar', 'foo', 'bar'));
134142
$this->assertSame('bar', Str::between('foobarbar', 'foo', 'bar'));
135143
}

0 commit comments

Comments
 (0)