1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-31 09:31:53 +02:00

Refactor line length calculation

This commit is contained in:
Oliver Vogel
2024-05-08 15:53:15 +02:00
parent 7f33feb743
commit 193324ec88
3 changed files with 29 additions and 4 deletions

View File

@@ -45,6 +45,21 @@ final class LineTest extends BaseTestCase
$this->assertEquals(2, $line->count());
}
public function testLength(): void
{
$line = new Line();
$this->assertEquals(0, $line->length());
$line = new Line("foo");
$this->assertEquals(3, $line->length());
$line = new Line("foo bar.");
$this->assertEquals(8, $line->length());
$line = new Line("🫷🙂🫸");
$this->assertEquals(3, $line->length());
}
public function testAdd(): void
{
$line = new Line();