You are here

public function TimeEfficientImplementationTest::testDistinctSequences in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/sebastian/diff/tests/LCS/TimeEfficientImplementationTest.php \SebastianBergmann\Diff\LCS\TimeEfficientImplementationTest::testDistinctSequences()

File

vendor/sebastian/diff/tests/LCS/TimeEfficientImplementationTest.php, line 82

Class

TimeEfficientImplementationTest
Some of these tests are volontary stressfull, in order to give some approximative benchmark hints.

Namespace

SebastianBergmann\Diff\LCS

Code

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);
  }
}