test: convert rm -rf && mkdir -p into %empty-directory

This converts the instances of the pattern for which we have a proper
substitution in lit.  This will make it easier to replace it
appropriately with Windows equivalents.
This commit is contained in:
Saleem Abdulrasool
2018-03-06 10:57:25 -08:00
parent 8ace7b8f7f
commit b67d5f0cf7
216 changed files with 260 additions and 333 deletions

View File

@@ -5,7 +5,7 @@ func foo() -> Int{
return aaa
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=2:1 -end-pos=5:13 >> %t.result/L2-5.swift
// RUN: diff -u %S/Outputs/basic/L2-5.swift.expected %t.result/L2-5.swift
// RUN: %refactor -extract-function -source-filename %s -pos=3:1 -end-pos=5:13 >> %t.result/L3-5.swift

View File

@@ -8,6 +8,6 @@ public func foo() -> Int{
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=6:26 >> %t.result/L5-6.swift
// RUN: diff -u %S/Outputs/extract_attributes/L5-6.swift.expected %t.result/L5-6.swift

View File

@@ -9,7 +9,7 @@ class C {
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=3:13 -end-pos=3:18 >> %t.result/ImplicitGetter.swift
// RUN: diff -u %S/Outputs/extract_from_accessor/ImplicitGetter.swift.expected %t.result/ImplicitGetter.swift

View File

@@ -7,6 +7,6 @@ class C {
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=6:15 >> %t.result/L5-6.swift
// RUN: diff -u %S/Outputs/extract_init/L5-6.swift.expected %t.result/L5-6.swift

View File

@@ -12,6 +12,6 @@ func returnFifteen() -> Int {
return y
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=9:6 >> %t.result/AvoidFilePrivate.swift
// RUN: diff -u %S/Outputs/extract_local/AvoidFilePrivate.swift.expected %t.result/AvoidFilePrivate.swift

View File

@@ -10,7 +10,7 @@ class A {
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=5:15 >> %t.result/FromGetter.swift
// RUN: diff -u %S/Outputs/extract_subscript/FromGetter.swift.expected %t.result/FromGetter.swift
// RUN: %refactor -extract-function -source-filename %s -pos=8:1 -end-pos=8:19 >> %t.result/FromSetter.swift

View File

@@ -5,6 +5,6 @@ func foo(_ a : inout [Int]) -> [Int] {
return a
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=2:1 -end-pos=5:11 >> %t.result/L2-5.swift
// RUN: diff -u %S/Outputs/extract_sugar/L2-5.swift.expected %t.result/L2-5.swift

View File

@@ -23,9 +23,9 @@ func foo2(_ e : MyEnum) -> Int {
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=8:1 -end-pos=15:4 >> %t.result/Void.swift
// RUN: diff -u %S/Outputs/extract_switch/Void.swift.expected %t.result/Void.swift
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=16:1 -end-pos=23:4 >> %t.result/Int.swift
// RUN: diff -u %S/Outputs/extract_switch/Int.swift.expected %t.result/Int.swift

View File

@@ -11,6 +11,6 @@ public func foo() -> Int{
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=6:1 -end-pos=7:26 >> %t.result/L6-7.swift
// RUN: diff -u %S/Outputs/extract_with_comments/L6-7.swift.expected %t.result/L6-7.swift

View File

@@ -12,6 +12,6 @@ public func new_name2() {}
public func new_name3() {}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=5:1 -end-pos=6:26 >> %t.result/L5-6.swift
// RUN: diff -u %S/Outputs/name_correction/L5-6.swift.expected %t.result/L5-6.swift

View File

@@ -12,7 +12,7 @@ class C {
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=3:1 -end-pos=5:13 >> %t.result/L3-5.swift
// RUN: diff -u %S/Outputs/static/L3-5.swift.expected %t.result/L3-5.swift
// RUN: %refactor -extract-function -source-filename %s -pos=9:1 -end-pos=11:13 >> %t.result/L9-11.swift

View File

@@ -17,7 +17,7 @@ func foo2() throws {
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=8:1 -end-pos=8:13 >> %t.result/L8-8.swift
// RUN: diff -u %S/Outputs/throw_errors/L8-8.swift.expected %t.result/L8-8.swift
// RUN: %refactor -extract-function -source-filename %s -pos=9:1 -end-pos=9:14 >> %t.result/L9-9.swift

View File

@@ -12,6 +12,6 @@ struct RefactorExtractProblem {
}
}
// RUN: rm -rf %t.result && mkdir -p %t.result
// RUN: %empty-directory(%t.result)
// RUN: %refactor -extract-function -source-filename %s -pos=7:1 -end-pos=11:6 >> %t.result/L7-11.swift
// RUN: diff -u %S/Outputs/throw_errors2/L7-11.swift.expected %t.result/L7-11.swift