Skip to content

Commit fb0985b

Browse files
committed
update test.
1 parent 0ce9f75 commit fb0985b

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

test/ClangImporter/enum-dataflow.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import user_objc
77

88
let aliasOriginal = NSAliasesEnum.byName
99

10-
switch aliasOriginal { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
11-
// expected-note@-1 {{missing case: '.differentValue'}}
10+
switch aliasOriginal { // expected-error {{switch must be exhaustive}}
11+
// expected-note@-1 {{add missing case: '.differentValue'}}
1212
case .original:
1313
break
1414
}
1515

16-
switch aliasOriginal { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
17-
// expected-note@-1 {{missing case: '.original'}}
18-
// expected-note@-2 {{missing case: '.differentValue'}}
16+
switch aliasOriginal { // expected-error {{switch must be exhaustive}}
17+
// expected-note@-1 {{add missing case: '.original'}}
18+
// expected-note@-2 {{add missing case: '.differentValue'}}
1919
case .bySameValue:
2020
break
2121
}

test/ClangImporter/enum-error.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ func testError() {
8383
switch (terr) { case .TENone, .TEOne, .TETwo: break } // ok
8484

8585
switch (terr) { case .TENone, .TEOne: break }
86-
// EXHAUSTIVE: [[@LINE-1]]:{{.+}}: error: switch must be exhaustive, consider adding missing cases
87-
// EXHAUSTIVE: [[@LINE-2]]:{{.+}}: note: missing case: '.TETwo'
86+
// EXHAUSTIVE: [[@LINE-1]]:{{.+}}: error: switch must be exhaustive
87+
// EXHAUSTIVE: [[@LINE-2]]:{{.+}}: note: add missing case: '.TETwo'
8888
let _ = TestError.Code(rawValue: 2)!
8989

9090
do {

test/ClangImporter/enum-new.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ func test() {
1313
case .Yellow, .Magenta, .Black, .Cyan: break
1414
} // no-error
1515

16-
switch getColorOptions() { // expected-error {{switch must be exhaustive, consider adding a default clause}}
16+
switch getColorOptions() { // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
1717
case ColorOptions.Pastel: break
1818
case ColorOptions.Swift: break
1919
}
2020

21-
switch 5 as Int16 { // expected-error {{switch must be exhaustive, consider adding a default clause}}
22-
case Zero: break // no-error
21+
switch 5 as Int16 { // expected-error {{'switch' statement body must have at least one 'case' or 'default' block; do you want to add a default case?}}
2322
}
2423
}

test/ClangImporter/swift2_warnings.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ class X : NSDocument {
9999
func makeProgress<T: NSProgressReporting>(thing: T) {} // expected-error {{'NSProgressReporting' has been renamed to 'ProgressReporting'}} {{22-41=ProgressReporting}}
100100

101101
func useLowercasedEnumCase(x: NSRuncingMode) {
102-
switch x { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
103-
// expected-note@-1 {{missing case: '.mince'}}
104-
// expected-note@-2 {{missing case: '.quince'}}
102+
switch x { // expected-error {{switch must be exhaustive}}
103+
// expected-note@-1 {{add missing case: '.mince'}}
104+
// expected-note@-2 {{add missing case: '.quince'}}
105105
case .Mince: return // expected-error {{'Mince' has been renamed to 'mince'}} {{11-16=mince}}
106106
case .Quince: return // expected-error {{'Quince' has been renamed to 'quince'}} {{11-17=quince}}
107107
}

test/stmt/statements.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ func breakContinue(_ x : Int) -> Int {
267267
Outer:
268268
for _ in 0...1000 {
269269

270-
Switch: // expected-error {{switch must be exhaustive, consider adding a default clause:}}
270+
Switch: // expected-error {{switch must be exhaustive}} expected-note{{do you want to add a default clause?}}
271271
switch x {
272272
case 42: break Outer
273273
case 97: continue Outer
@@ -299,7 +299,7 @@ Loop: // expected-note {{previously declared here}}
299299
let x : Int? = 42
300300

301301
// <rdar://problem/16879701> Should be able to pattern match 'nil' against optionals
302-
switch x { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
302+
switch x { // expected-error {{switch must be exhaustive}}
303303
// expected-note@-1 {{missing case: '.some(_)'}}
304304
case .some(42): break
305305
case nil: break
@@ -452,7 +452,7 @@ enum Type {
452452
case Bar
453453
}
454454
func r25178926(_ a : Type) {
455-
switch a { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
455+
switch a { // expected-error {{switch must be exhaustive}}
456456
// expected-note@-1 {{missing case: '.Bar'}}
457457
case .Foo, .Bar where 1 != 100:
458458
// expected-warning @-1 {{'where' only applies to the second pattern match in this case}}
@@ -461,20 +461,20 @@ func r25178926(_ a : Type) {
461461
break
462462
}
463463

464-
switch a { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
464+
switch a { // expected-error {{switch must be exhaustive}}
465465
// expected-note@-1 {{missing case: '.Bar'}}
466466
case .Foo: break
467467
case .Bar where 1 != 100: break
468468
}
469469

470-
switch a { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
470+
switch a { // expected-error {{switch must be exhaustive}}
471471
// expected-note@-1 {{missing case: '.Bar'}}
472472
case .Foo, // no warn
473473
.Bar where 1 != 100:
474474
break
475475
}
476476

477-
switch a { // expected-error {{switch must be exhaustive, consider adding missing cases:}}
477+
switch a { // expected-error {{switch must be exhaustive}}
478478
// expected-note@-1 {{missing case: '.Foo'}}
479479
// expected-note@-2 {{missing case: '.Bar'}}
480480
case .Foo where 1 != 100, .Bar where 1 != 100:

0 commit comments

Comments
 (0)