From 7030fc54badf8e47013eae570974caf40e967fbe Mon Sep 17 00:00:00 2001 From: kawax Date: Sun, 24 Nov 2024 11:13:07 +0900 Subject: [PATCH] Update TextBuilderTest.php --- tests/Feature/RichText/TextBuilderTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/Feature/RichText/TextBuilderTest.php b/tests/Feature/RichText/TextBuilderTest.php index cdb9e01c..a862f0f8 100644 --- a/tests/Feature/RichText/TextBuilderTest.php +++ b/tests/Feature/RichText/TextBuilderTest.php @@ -38,18 +38,20 @@ public function test_detect_facets_link() $this->assertSame(55, data_get($builder->facets, '2.index.byteStart')); $this->assertSame(72, data_get($builder->facets, '2.index.byteEnd')); - $this->assertSame(['https://localhost', 'https://localhost/?test=a', 'https://localhost','https://example.com', 'https://localhost/', 'https://localhost/#hash'], collect($builder->facets)->pluck('features.0.uri')->toArray()); + $this->assertSame(['https://localhost', 'https://localhost/?test=a', 'https://localhost', 'https://example.com', 'https://localhost/', 'https://localhost/#hash'], collect($builder->facets)->pluck('features.0.uri')->toArray()); } public function test_detect_facets_tag() { - $builder = TextBuilder::make('#test #a_ #γ‚‘ #γ‚“ #ΓΌ #_ #πŸ˜‡ #')->detectFacets(); + $builder = TextBuilder::make('#test #a_ #γ‚‘ οΌƒγ‚“ #ΓΌ #_ #πŸ˜‡ #')->detectFacets(); $this->assertIsArray($builder->facets); $this->assertSame(0, data_get($builder->facets, '0.index.byteStart')); $this->assertSame(5, data_get($builder->facets, '0.index.byteEnd')); $this->assertSame(10, data_get($builder->facets, '2.index.byteStart')); $this->assertSame(14, data_get($builder->facets, '2.index.byteEnd')); + $this->assertSame(15, data_get($builder->facets, '3.index.byteStart')); + $this->assertSame(21, data_get($builder->facets, '3.index.byteEnd')); $this->assertSame(['test', 'a', 'γ‚‘', 'γ‚“', 'ΓΌ', 'πŸ˜‡'], collect($builder->facets)->pluck('features.0.tag')->toArray()); }