Skip to content

Commit

Permalink
modified files readme, gendiff, difftest
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmuS2024 committed Oct 21, 2024
1 parent 09c2093 commit e467c7b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
<a href="https://asciinema.org/a/sajdPQG2NqP2Ky51Kyp4SDpBp" target="_blank"><img src="https://asciinema.org/a/sajdPQG2NqP2Ky51Kyp4SDpBp.svg" width="400" height="300" /></a>

## Gendiff process with YAML files in asciinema:
<a href="https://asciinema.org/a/rV1BXXmxURj3LKG9UDLQcDJvi" target="_blank"><img src="https://asciinema.org/a/rV1BXXmxURj3LKG9UDLQcDJvi.svg" width="400" height="300" /></a>
<a href="https://asciinema.org/a/rV1BXXmxURj3LKG9UDLQcDJvi" target="_blank"><img src="https://asciinema.org/a/rV1BXXmxURj3LKG9UDLQcDJvi.svg" width="400" height="300" /></a>

## Gendiff process with json and YAML files with nested structure in asciinema:
<a href="https://asciinema.org/a/nUzyU01TNMRxl5NX8fDdVE54V" target="_blank"><img src="https://asciinema.org/a/nUzyU01TNMRxl5NX8fDdVE54V.svg" width="400" height="300" /></a>
6 changes: 3 additions & 3 deletions bin/gendiff
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ Usage:
Options:
-h --help Show this screen.
-v --version Show version.
--format <fmt> Report format [default: json]
--format <fmt> Report format [default: stylish]
DOC;

$args = Docopt::handle($doc, array('version'=>'Generate diff version 0.1 (12.10.2024)'))->args;
$args = Docopt::handle($doc, array('version'=>'Generate diff version 0.2 (21.10.2024)'))->args;
if (array_key_exists("<firstFile>", $args) & array_key_exists('<secondFile>', $args)) {
$result = genDiff($args['<firstFile>'], $args['<secondFile>']);
$result = genDiff($args['<firstFile>'], $args['<secondFile>'], $args['--format']);
print_r($result);
}
9 changes: 9 additions & 0 deletions tests/DiffTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,13 @@ public function testFilesDiffYaml(): void
$diffStringFromFiles = genDiff($pathToFile1, $pathToFile2);
$this->assertStringEqualsFile($pathToFile3, $diffStringFromFiles);
}

public function testFilesDiffYaml2(): void
{
$pathToFile1 = $this->getFixtureFullPath('2/file1.yaml');
$pathToFile2 = $this->getFixtureFullPath('2/file2.yml');
$pathToFile3 = $this->getFixtureFullPath('2/result.txt');
$diffStringFromFiles = genDiff($pathToFile1, $pathToFile2);
$this->assertStringEqualsFile($pathToFile3, $diffStringFromFiles);
}
}

0 comments on commit e467c7b

Please sign in to comment.