Skip to content

Commit 8d35bcc

Browse files
Revert "[APINotes] Prefer diff -u over diff -b"
This reverts commit 3b1ca5e. This is causing failures on MacOS because the default head implementation does not support negative numbers. Reverting for now so I can come up with a more principled fix in the morning.
1 parent 6076b07 commit 8d35bcc

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
RUN: apinotes-test %S/Inputs/Frameworks/SimpleKit.framework/Headers/SimpleKit.apinotes > %t.result
2-
RUN: not diff -u %S/Inputs/Frameworks/SimpleKit.framework/Headers/SimpleKit.apinotes %t.result | \
3-
RUN: tail -n +4 | \
4-
RUN: FileCheck %s --implicit-check-not="{{^\+}}" --implicit-check-not="{{^\-}}"
2+
RUN: not diff -b -e %t.result %S/Inputs/Frameworks/SimpleKit.framework/Headers/SimpleKit.apinotes | FileCheck %s
3+
4+
The `-e` option of `diff` is not implemented in the builtin diff, assume
5+
that we have a POSIX compatible diff when we have a shell.
6+
REQUIRES: shell
57

68
We expect only the document markers to be emitted
79

8-
CHECK: +---
9-
CHECK: +...
10+
CHECK: 52d
11+
CHECK: 1d
Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
RUN: apinotes-test %S/Inputs/Frameworks/Simple.framework/Headers/Simple.apinotes > %t.result
2-
RUN: not diff -u %S/Inputs/Frameworks/Simple.framework/Headers/Simple.apinotes %t.result | \
3-
RUN: tail -n +5 | head -n -1 | \
4-
RUN: FileCheck %s --implicit-check-not="{{^\+}}" --implicit-check-not="{{^\-}}"
2+
RUN: not diff -b %S/Inputs/Frameworks/Simple.framework/Headers/Simple.apinotes %t.result | FileCheck %s
3+
4+
Avoid Windows as the diff output differs due to line-endings and different diff
5+
implementations.
6+
UNSUPPORTED: system-windows
57

68
We expect only the nullability to be different as it is canonicalized during the
79
roudtrip.
810

9-
CHECK: - Nullability: N
10-
CHECK-NEXT: + Nullability: Nonnull
11-
CHECK: - Nullability: O
12-
CHECK-NEXT: + Nullability: Optional
13-
CHECK: - Nullability: U
14-
CHECK-NEXT: + Nullability: Unspecified
15-
CHECK: - Nullability: S
16-
CHECK-NEXT: + Nullability: Unspecified
17-
CHECK: - Nullability: Scalar
18-
CHECK-NEXT: + Nullability: Unspecified
11+
CHECK: 7c8
12+
CHECK-NEXT: < Nullability: N
13+
CHECK-NEXT: ---
14+
CHECK-NEXT: > Nullability: Nonnull
15+
CHECK-NEXT: 13c14
16+
CHECK-NEXT: < Nullability: O
17+
CHECK-NEXT: ---
18+
CHECK-NEXT: > Nullability: Optional
19+
CHECK-NEXT: 19c20
20+
CHECK-NEXT: < Nullability: U
21+
CHECK-NEXT: ---
22+
CHECK-NEXT: > Nullability: Unspecified
23+
CHECK-NEXT: 25c26
24+
CHECK-NEXT: < Nullability: S
25+
CHECK-NEXT: ---
26+
CHECK-NEXT: > Nullability: Unspecified
27+
CHECK-NEXT: 28c29
28+
CHECK-NEXT: < Nullability: Scalar
29+
CHECK-NEXT: ---
30+
CHECK-NEXT: > Nullability: Unspecified

0 commit comments

Comments
 (0)