Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Commit 020e1da

Browse files
WizKidfacebook-github-bot
authored andcommitted
Wrap more stuff
Summary: - Wrap a bunch of more stuff Reviewed By: viratyosin Differential Revision: D13388257 fbshipit-source-id: 1337a68b1a08477f52800ddbd24a09225ae02110
1 parent 107ae5c commit 020e1da

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/ColoredUnifiedDiff.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ final public static function create(
112112
$next = Str\slice($next, 1);
113113
$lines = Vec\drop($lines, 1);
114114

115+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
116+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
115117
$words_line = vec(\preg_split('/([^a-zA-Z0-9_]+)/', $line, -1, \PREG_SPLIT_DELIM_CAPTURE));
118+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
119+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
116120
$words_next = vec(\preg_split('/([^a-zA-Z0-9_]+)/', $next, -1, \PREG_SPLIT_DELIM_CAPTURE));
117121
$intraline = (new StringDiff($words_line, $words_next))->getDiff();
118122
$out[] = $intraline

tests/StringDiffTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,29 @@ public function testDiffCharacters(): void {
4949

5050
public function provideExamples(): vec<varray<string>> {
5151
return Vec\map(
52+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
53+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
5254
\glob(__DIR__.'/examples/*.a'),
55+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
56+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
5357
$ex ==> varray[\basename($ex, '.a')],
5458
);
5559
}
5660

5761
<<DataProvider('provideExamples')>>
5862
public function testUnifiedDiff(string $name): void {
5963
$base = __DIR__.'/examples/'.$name;
64+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
65+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
6066
$a = \file_get_contents($base.'.a');
67+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
68+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
6169
$b = \file_get_contents($base.'.b');
6270
$diff = StringDiff::lines($a, $b)->getUnifiedDiff();
6371

6472
expect($diff)->toBeSame(
73+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
74+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
6575
\file_get_contents($base.'.udiff.expect'),
6676
'Did not match expected contents '.
6777
'(from diff -u %s.a %s.b | tail -n +3 > %s.udiff.expect)',
@@ -74,12 +84,20 @@ public function testUnifiedDiff(string $name): void {
7484
<<DataProvider('provideExamples')>>
7585
public function testCLIColoredDiff(string $name): void {
7686
$base = __DIR__.'/examples/'.$name;
87+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
88+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
7789
$a = \file_get_contents($base.'.a');
90+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
91+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
7892
$b = \file_get_contents($base.'.b');
7993
$diff = CLIColoredUnifiedDiff::create($a, $b);
8094

95+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
96+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
8197
\file_put_contents($base.'.clidiff.out', $diff);
8298

99+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
100+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
83101
if (!\file_exists($base.'.clidiff.expect')) {
84102
self::markTestIncomplete(Str\format(
85103
"No expect file present; maybe:\n cp %s.clidiff.out %s.clidiff.expect",
@@ -89,6 +107,8 @@ public function testCLIColoredDiff(string $name): void {
89107
}
90108

91109
expect($diff)->toBeSame(
110+
/* HH_IGNORE_ERROR[4107] using directly because this is open source */
111+
/* HH_IGNORE_ERROR[2049] using directly because this is open source */
92112
\file_get_contents($base.'.clidiff.expect'),
93113
'Did not match expected contents (- %s.clidiff.expect, + %s.clidiff.out)',
94114
$base,

0 commit comments

Comments
 (0)