Skip to content

Commit e443cf1

Browse files
committed
Fix UnexpectedCountType.swift
This test case failed in CI when using a strict diff, because the output also contained the text "swift runtime: unknown backtracing setting 'warnings'". Switch to using FileCheck to ignore this output.
1 parent 4668a0c commit e443cf1

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

test/Macros/SwiftifyImport/MacroErrors/UnexpectedCountType.swift

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,14 @@ func myFunc(_ ptr: UnsafePointer<CInt>, _ len: String) {
1010
// REQUIRES: swift_swift_parser
1111
// RUN: %empty-directory(%t)
1212
// RUN: split-file %s %t
13-
// RUN: %target-swift-frontend %t/test.swift -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -verify 2> %t/dump.txt
14-
// RUN: diff %t/myFunc.expected %t/dump.txt
13+
// RUN: %target-swift-frontend %t/test.swift -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -verify 2>&1 | %FileCheck %s --match-full-lines --strict-whitespace
1514

16-
//--- myFunc.expected
17-
@__swiftmacro_4main6myFunc15_SwiftifyImportfMp_.swift
18-
------------------------------
19-
/// This is an auto-generated wrapper for safer interop
20-
@_alwaysEmitIntoClient @_disfavoredOverload
21-
func myFunc(_ ptr: UnsafeBufferPointer<CInt>) {
22-
let len = String(exactly: unsafe ptr.count)!
23-
return unsafe myFunc(ptr.baseAddress!, len)
24-
}
25-
------------------------------
15+
// CHECK:@__swiftmacro_4main6myFunc15_SwiftifyImportfMp_.swift
16+
// CHECK-NEXT:------------------------------
17+
// CHECK-NEXT:/// This is an auto-generated wrapper for safer interop
18+
// CHECK-NEXT:@_alwaysEmitIntoClient @_disfavoredOverload
19+
// CHECK-NEXT:func myFunc(_ ptr: UnsafeBufferPointer<CInt>) {
20+
// CHECK-NEXT: let len = String(exactly: unsafe ptr.count)!
21+
// CHECK-NEXT: return unsafe myFunc(ptr.baseAddress!, len)
22+
// CHECK-NEXT:}
23+
// CHECK-NEXT:------------------------------

0 commit comments

Comments
 (0)