Annotation of embedaddon/php/ext/gmp/tests/014.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: gmp_fact() basic tests
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("gmp")) print "skip"; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: var_dump(gmp_strval(gmp_fact(0)));
                      9: var_dump(gmp_strval(gmp_fact("")));
                     10: var_dump(gmp_strval(gmp_fact("0")));
                     11: var_dump(gmp_strval(gmp_fact("-1")));
                     12: var_dump(gmp_strval(gmp_fact(-1)));
                     13: var_dump(gmp_strval(gmp_fact(1.1)));
                     14: var_dump(gmp_strval(gmp_fact(20)));
                     15: var_dump(gmp_strval(gmp_fact("50")));
                     16: var_dump(gmp_strval(gmp_fact("10")));
                     17: var_dump(gmp_strval(gmp_fact("0000")));
                     18: 
                     19: $n = gmp_init(12);
                     20: var_dump(gmp_strval(gmp_fact($n)));
                     21: $n = gmp_init(-10);
                     22: var_dump(gmp_strval(gmp_fact($n)));
                     23: 
                     24: var_dump(gmp_fact());
                     25: var_dump(gmp_fact(1,1));
                     26: var_dump(gmp_fact(array()));
                     27: var_dump(gmp_strval(gmp_fact(array())));
                     28: 
                     29: echo "Done\n";
                     30: ?>
                     31: --EXPECTF--    
                     32: string(1) "1"
                     33: string(1) "1"
                     34: string(1) "1"
                     35: 
                     36: Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
                     37: string(1) "0"
                     38: 
                     39: Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
                     40: string(1) "0"
                     41: string(1) "1"
                     42: string(19) "2432902008176640000"
                     43: string(65) "30414093201713378043612608166064768844377641568960512000000000000"
                     44: string(7) "3628800"
                     45: string(1) "1"
                     46: string(11) "87178291200"
                     47: 
                     48: Warning: gmp_fact(): Number has to be greater than or equal to 0 in %s on line %d
                     49: string(1) "0"
                     50: 
                     51: Warning: gmp_fact() expects exactly 1 parameter, 0 given in %s on line %d
                     52: NULL
                     53: 
                     54: Warning: gmp_fact() expects exactly 1 parameter, 2 given in %s on line %d
                     55: NULL
                     56: resource(%d) of type (GMP integer)
                     57: string(1) "1"
                     58: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>