mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Dependency Scanner] Do not escape strings in the scanner output
When outputting strings for things like filenames, using `write_escaped` will result in Unicode characters being outputted with a full 3-character-octal or hex escape. Clients which expect a UTF-8 JSON output will not be able to parse such escape sequences.
This commit is contained in:
16
test/ScanDependencies/unicode_filename.swift
Normal file
16
test/ScanDependencies/unicode_filename.swift
Normal file
@@ -0,0 +1,16 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-swift-frontend -scan-dependencies %s %S/Inputs/unicode_filёnamё.swift -o %t/deps.json
|
||||
|
||||
// Check the contents of the JSON output
|
||||
// RUN: %FileCheck %s < %t/deps.json
|
||||
|
||||
print(foo())
|
||||
|
||||
// CHECK: "swift": "deps"
|
||||
// CHECK-NEXT: },
|
||||
// CHECK-NEXT: {
|
||||
// CHECK-NEXT: "modulePath": "deps.swiftmodule",
|
||||
// CHECK-NEXT: "sourceFiles": [
|
||||
// CHECK-NEXT: "{{.*}}ScanDependencies{{/|\\}}unicode_filename.swift",
|
||||
// CHECK-NEXT: "{{.*}}ScanDependencies{{/|\\}}Inputs{{/|\\}}unicode_filёnamё.swift"
|
||||
// CHECK-NEXT: ],
|
||||
Reference in New Issue
Block a user