~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/standard/tests/strings/trim.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
trim(), rtrim() and ltrim() functions
 
3
--FILE--
 
4
<?php
 
5
 
 
6
$tests = <<<TESTS
 
7
'ABC' ===  trim('ABC')
 
8
'ABC' === ltrim('ABC')
 
9
'ABC' === rtrim('ABC')
 
10
'ABC' ===  trim(" \\0\\t\\nABC \\0\\t\\n")
 
11
"ABC \\0\\t\\n" === ltrim(" \\0\\t\\nABC \\0\\t\\n")
 
12
" \\0\\t\\nABC" === rtrim(" \\0\\t\\nABC \\0\\t\\n")
 
13
" \\0\\t\\nABC \\0\\t\\n" ===  trim(" \\0\\t\\nABC \\0\\t\\n",'')
 
14
" \\0\\t\\nABC \\0\\t\\n" === ltrim(" \\0\\t\\nABC \\0\\t\\n",'')
 
15
" \\0\\t\\nABC \\0\\t\\n" === rtrim(" \\0\\t\\nABC \\0\\t\\n",'')
 
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
"ABC\\x50\\xC1" === trim("ABC\\x50\\xC1\\x60\\x90","\\x51..\\xC0")
 
20
"ABC\\x50" === trim("ABC\\x50\\xC1\\x60\\x90","\\x51..\\xC1")
 
21
"ABC" === trim("ABC\\x50\\xC1\\x60\\x90","\\x50..\\xC1")
 
22
TESTS;
 
23
 
 
24
include(dirname(__FILE__) . '/../../../../tests/quicktester.inc');
 
25
 
 
26
--EXPECT--
 
27
OK