PageRenderTime 29ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/hphp/test/zend/good/ext/standard/tests/strings/trim.php

http://github.com/facebook/hiphop-php
PHP | 22 lines | 21 code | 1 blank | 0 comment | 0 complexity | 1051b561d097540a717848c928175c8b MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?hh
  2. <<__EntryPoint>> function main(): void {
  3. $tests = <<<TESTS
  4. 'ABC' === trim('ABC')
  5. 'ABC' === ltrim('ABC')
  6. 'ABC' === rtrim('ABC')
  7. 'ABC' === trim(" \\0\\t\\nABC \\0\\t\\n")
  8. "ABC \\0\\t\\n" === ltrim(" \\0\\t\\nABC \\0\\t\\n")
  9. " \\0\\t\\nABC" === rtrim(" \\0\\t\\nABC \\0\\t\\n")
  10. " \\0\\t\\nABC \\0\\t\\n" === trim(" \\0\\t\\nABC \\0\\t\\n",'')
  11. " \\0\\t\\nABC \\0\\t\\n" === ltrim(" \\0\\t\\nABC \\0\\t\\n",'')
  12. " \\0\\t\\nABC \\0\\t\\n" === rtrim(" \\0\\t\\nABC \\0\\t\\n",'')
  13. "ABC\\x50\\xC1" === trim("ABC\\x50\\xC1\\x60\\x90","\\x51..\\xC0")
  14. "ABC\\x50" === trim("ABC\\x50\\xC1\\x60\\x90","\\x51..\\xC1")
  15. "ABC" === trim("ABC\\x50\\xC1\\x60\\x90","\\x50..\\xC1")
  16. "ABC\\x50\\xC1" === trim("ABC\\x50\\xC1\\x60\\x90","\\x51..\\xC0")
  17. "ABC\\x50" === trim("ABC\\x50\\xC1\\x60\\x90","\\x51..\\xC1")
  18. "ABC" === trim("ABC\\x50\\xC1\\x60\\x90","\\x50..\\xC1")
  19. TESTS;
  20. include(dirname(__FILE__) . '/../../../../tests/quicktester.inc');
  21. }