diff --git a/core/tests/Drupal/Tests/Component/Serialization/YamlSymfonyTest.php b/core/tests/Drupal/Tests/Component/Serialization/YamlSymfonyTest.php index 445150a..684ff15 100644 --- a/core/tests/Drupal/Tests/Component/Serialization/YamlSymfonyTest.php +++ b/core/tests/Drupal/Tests/Component/Serialization/YamlSymfonyTest.php @@ -63,4 +63,20 @@ public function testError() { YamlSymfony::decode('foo: [ads'); } + /** + * Tests that preg jit compiler doesn't break decoding strings with newlines. + * + * @covers ::decode + */ + public function testNewlines() { + $string = str_repeat('\n', 2700); + $yaml = 'string: "' . $string . '"'; + $config = YamlSymfony::decode($yaml); + $this->assertEquals(str_repeat("\n", 2700), $config['string']); + + $string = str_repeat('\n', 2800); + $yaml = 'string: "' . $string . '"'; + $config = YamlSymfony::decode($yaml); + $this->assertEquals(str_repeat("\n", 2800), $config['string']); + } }