Skip to content

Commit

Permalink
test: testEncodeOrdinary
Browse files Browse the repository at this point in the history
  • Loading branch information
danny50610 committed Aug 21, 2023
1 parent 2de45e4 commit 5966eeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,4 @@ _tinker*.php
.phpunit.result.cache
.phpunit.cache/
composer.lock
coverage
8 changes: 8 additions & 0 deletions tests/EncodingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ public function testDecodeWithSpecial()
}

public function testEncodeOrdinary()
{
$enc = EncodingFactory::createByEncodingName('cl100k_base');
$tokens = $enc->encodeOrdinary('Hello world');

$this->assertSame([9906, 1917], $tokens);
}

public function testEncodeOrdinaryWithDisallowedSpecial()
{
$enc = EncodingFactory::createByEncodingName('cl100k_base');
$tokens1 = $enc->encodeOrdinary('🫡🍣顏文字');
Expand Down

0 comments on commit 5966eeb

Please sign in to comment.