Skip to content

Commit f0aadda

Browse files
authored
Merge pull request swiftlang#40172 from keith/ks/driver-add-test-for-vfs-path-behavior-nfc
[Driver] Add test for vfs path behavior (NFC)
2 parents a448cdd + 7a1a01a commit f0aadda

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/Driver/vfs.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@
1111
// Verifies that input paths are not rejected prematurely when -vfsoverlay is present as they may exist on the vfs (which the frontend accounts for) even if they don't exist on the real file system.
1212
// RUN: not %swiftc_driver -driver-print-jobs -c %t/file-not-on-the-real-filesystem.swift
1313
// RUN: %swiftc_driver -driver-print-jobs -c -vfsoverlay overlay1.yaml %t/file-not-on-the-real-filesystem.swift
14+
15+
// RUN: mkdir -p %t
16+
// RUN: cd %t
17+
// RUN: echo "foobar" > main.swift
18+
// RUN: not %swiftc_driver main.swift 2>&1 | %FileCheck --check-prefix=CHECK-ERROR %s
19+
// RUN: echo '{"roots": [],"version": 0}' > %t.yaml
20+
// RUN: not %swiftc_driver -vfsoverlay %t.yaml main.swift 2>&1 | %FileCheck --check-prefix=CHECK-ERROR %s
21+
// RUN: echo '{"version": 0,"roots":[{"type":"directory","name":"%/t","contents":[{"type":"file","name":"vfsname.swift", "external-contents":"main.swift"}]}]}' > %t.yaml
22+
// RUN: not %swiftc_driver -vfsoverlay %t.yaml vfsname.swift -v 2>&1 | %FileCheck --check-prefix=CHECK-ERROR %s
23+
// CHECK-ERROR: {{^}}main.swift:1:1: error:

0 commit comments

Comments
 (0)