Skip to content

Commit 5132b12

Browse files
authored
Merge pull request #1858 from pcbeard/pcbeard/RedirectReplInput_TestsOnly_next
Tests for REPL input redirection
2 parents 917f646 + 2399ba0 commit 5132b12

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Test that input can be redirected from A.swift
2+
3+
// RUN: mkdir -p %t
4+
// RUN: cp %S/Inputs/A.swift %t/A.swift
5+
// RUN: cd %t
6+
// RUN: %lldb --repl < %s | FileCheck %s
7+
8+
< A.swift
9+
10+
Foo.foo()
11+
// CHECK: ${{R0}}: String = "A"
12+
13+
let y = MyPoint(x: 2, y: 2)
14+
// CHECK: {{^}}y: MyPoint = {
15+
16+
y.magnitudeSquared
17+
// CHECK: {{^}}${{R1}}: Int = 8
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Test that input can't be redirected from non-existent file A.swift
2+
3+
// RUN: mkdir -p %t
4+
// RUN: cd %t
5+
// RUN: %lldb --repl < %s 2>&1 | FileCheck %s --check-prefix=LLDB
6+
7+
< A.swift
8+
// LLDB: no such file at path 'A.swift'
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that input can't be redirected from unreadable A.swift
2+
3+
// RUN: mkdir -p %t
4+
// RUN: cp %S/Inputs/A.swift %t/A.swift
5+
// RUN: chmod -r %t/A.swift
6+
// RUN: cd %t
7+
// RUN: %lldb --repl < %s 2>&1 | FileCheck %s --check-prefix=LLDB
8+
9+
< A.swift
10+
// LLDB: could not read file at path 'A.swift'

0 commit comments

Comments
 (0)