1--TEST--
2Test convert_uudecode() function : basic functionality
3--FILE--
4<?php
5
6echo "*** Testing convert_uudecode() : basic functionality ***\n";
7
8// array with different values for $string
9$strings =  array (
10
11  //double quoted strings
12  "123",
13  "abc",
14  "1a2b3c",
15  "Here is a simple string to test convert_uuencode/decode",
16  "\t This String contains \t\t some control characters\r\n",
17  "\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f",
18
19   //single quoted strings
20  '123',
21  'abc',
22  '1a2b3c',
23  '\t This String contains \t\t some control characters\r\n',
24
25);
26
27// loop through with each element of the $strings array to test convert_uudecode() function
28$count = 1;
29foreach($strings as $string) {
30
31  $encode = convert_uuencode($string);
32  $decode = convert_uudecode($encode);
33
34  if ($decode != $string) {
35    var_dump($encode, $decode, $string);
36    exit("TEST FAILED on iteration $count\n");
37  }
38
39  $count ++;
40}
41
42echo "TEST PASSED\n";
43
44?>
45--EXPECT--
46*** Testing convert_uudecode() : basic functionality ***
47TEST PASSED
48