!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/it-man.ztu.edu.ua/src/vendor/sebastian/diff/tests/LCS/   drwxr-xr-x
Free 116.86 GB of 200.55 GB (58.27%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     TimeEfficientImplementationTest.php (5.31 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
 * This file is part of the Diff package.
 *
 * (c) Sebastian Bergmann <sebastian@phpunit.de>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace SebastianBergmann\Diff\LCS;

use 
PHPUnit_Framework_TestCase;

/**
 * Some of these tests are volontary stressfull, in order to give some approximative benchmark hints.
 */
class TimeEfficientImplementationTest extends PHPUnit_Framework_TestCase
{
    private 
$implementation;
    private 
$memory_limit;
    private 
$stress_sizes = array(12310050010002000);

    protected function 
setUp()
    {
        
$this->memory_limit ini_get('memory_limit');
        
ini_set('memory_limit''256M');

        
$this->implementation = new TimeEfficientImplementation;
    }

    protected function 
tearDown()
    {
        
ini_set('memory_limit'$this->memory_limit);
    }

    public function 
testBothEmpty()
    {
        
$from   = array();
        
$to     = array();
        
$common $this->implementation->calculate($from$to);

        
$this->assertEquals(array(), $common);
    }

    public function 
testIsStrictComparison()
    {
        
$from = array(
            
false00.0''null, array(),
            
true11.0'foo', array('foo''bar'), array('foo' => 'bar')
        );
        
$to     $from;
        
$common $this->implementation->calculate($from$to);

        
$this->assertEquals($from$common);

        
$to = array(
            
falsefalsefalsefalsefalsefalse,
            
truetruetruetruetruetrue
        
);
        
$expected = array(
            
false,
            
true,
        );
        
$common $this->implementation->calculate($from$to);

        
$this->assertEquals($expected$common);
    }

    public function 
testEqualSequences()
    {
        foreach (
$this->stress_sizes as $size) {
            
$range  range(1$size);
            
$from   $range;
            
$to     $range;
            
$common $this->implementation->calculate($from$to);

            
$this->assertEquals($range$common);
        }
    }

    public function 
testDistinctSequences()
    {
        
$from   = array('A');
        
$to     = array('B');
        
$common $this->implementation->calculate($from$to);
        
$this->assertEquals(array(), $common);

        
$from   = array('A''B''C');
        
$to     = array('D''E''F');
        
$common $this->implementation->calculate($from$to);
        
$this->assertEquals(array(), $common);

        foreach (
$this->stress_sizes as $size) {
            
$from   range(1$size);
            
$to     range($size 1$size 2);
            
$common $this->implementation->calculate($from$to);
            
$this->assertEquals(array(), $common);
        }
    }

    public function 
testCommonSubsequence()
    {
        
$from     = array('A',      'C',      'E''F''G');
        
$to       = array('A''B',      'D''E',           'H');
        
$expected = array('A',                'E');
        
$common   $this->implementation->calculate($from$to);
        
$this->assertEquals($expected$common);

        
$from     = array('A',      'C',      'E''F''G');
        
$to       = array('B''C''D''E''F',      'H');
        
$expected = array('C',                'E''F');
        
$common   $this->implementation->calculate($from$to);
        
$this->assertEquals($expected$common);

        foreach (
$this->stress_sizes as $size) {
            
$from     $size ? array(1) : range(1$size 12);
            
$to       $size ? array(1) : range(1$size 13);
            
$expected $size ? array(1) : range(1$size 16);
            
$common   $this->implementation->calculate($from$to);

            
$this->assertEquals($expected$common);
        }
    }

    public function 
testSingleElementSubsequenceAtStart()
    {
        foreach (
$this->stress_sizes as $size) {
            
$from   range(1$size);
            
$to     array_slice($from01);
            
$common $this->implementation->calculate($from$to);

            
$this->assertEquals($to$common);
        }
    }

    public function 
testSingleElementSubsequenceAtMiddle()
    {
        foreach (
$this->stress_sizes as $size) {
            
$from   range(1$size);
            
$to     array_slice($from, (int) $size 21);
            
$common $this->implementation->calculate($from$to);

            
$this->assertEquals($to$common);
        }
    }

    public function 
testSingleElementSubsequenceAtEnd()
    {
        foreach (
$this->stress_sizes as $size) {
            
$from   range(1$size);
            
$to     array_slice($from$size 11);
            
$common $this->implementation->calculate($from$to);

            
$this->assertEquals($to$common);
        }
    }

    public function 
testReversedSequences()
    {
        
$from     = array('A''B');
        
$to       = array('B''A');
        
$expected = array('A');
        
$common   $this->implementation->calculate($from$to);
        
$this->assertEquals($expected$common);

        foreach (
$this->stress_sizes as $size) {
            
$from   range(1$size);
            
$to     array_reverse($from);
            
$common $this->implementation->calculate($from$to);

            
$this->assertEquals(array(1), $common);
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0401 ]--