优化跳过性能

This commit is contained in:
2020-12-19 15:17:13 +08:00
parent 4c4be41f8b
commit 89470252e7
3 changed files with 100 additions and 44 deletions

View File

@ -29,13 +29,13 @@ class StringReaderTest extends TestCase
'moveToNextLines' => [],
];
$this->thingsWithCrLf = [
'original' => " 中文 \r\n\r 这是 \r Is \n\n 一个 新的 TOken",
'tokens' => ["中文", "这是", "Is", "一个", "新的", "TOken"],
'nextTokens' => ["这是", "Is", "一个", "新的", "TOken", ""],
'positions' => [1, 8, 13, 19, 22, 25],
'lines' => [1, 3, 4, 6, 6, 6],
'linePositions' => [1, 1, 1, 1, 4, 7],
'moveToNextLines' => [1, 2, 3],
'original' => " 中文 \r\n\r 这是 \r Is A \n\n 一个 新的 TOken",
'tokens' => ["中文", "这是", "Is", "A", "一个", "新的", "TOken"],
'nextTokens' => ["这是", "Is", "A", "一个", "新的", "TOken", ""],
'positions' => [1, 8, 13, 16, 21, 24, 27],
'lines' => [1, 3, 4, 4, 6, 6, 6],
'linePositions' => [1, 1, 1, 4, 1, 4, 7],
'moveToNextLines' => [1, 2, 4],
];
$this->reader = new StringReader($this->things['original']);
$this->readerWithCrLf = new StringReader($this->thingsWithCrLf['original']);