| ... | @@ -410,8 +410,8 @@ test "switch on integer with else capturing expr" { | ... | @@ -410,8 +410,8 @@ test "switch on integer with else capturing expr" { |
| 410 | var x: i32 = 5; | 410 | var x: i32 = 5; |
| 411 | _ = &x; | 411 | _ = &x; |
| 412 | switch (x + 10) { | 412 | switch (x + 10) { |
| 413 | 14 => @panic("fail"), | 413 | 14 => return error.TestFailed, |
| 414 | 16 => @panic("fail"), | 414 | 16 => return error.TestFailed, |
| 415 | else => |e| try expect(e == 15), | 415 | else => |e| try expect(e == 15), |
| 416 | } | 416 | } |
| 417 | } | 417 | } |
| ... | @@ -522,7 +522,7 @@ test "switch with null and T peer types and inferred result location type" { | ... | @@ -522,7 +522,7 @@ test "switch with null and T peer types and inferred result location type" { |
| 522 | else => null, | 522 | else => null, |
| 523 | }) |v| { | 523 | }) |v| { |
| 524 | _ = v; | 524 | _ = v; |
| 525 | @panic("fail"); | 525 | return error.TestFailed; |
| 526 | } | 526 | } |
| 527 | } | 527 | } |
| 528 | }; | 528 | }; |
| ... | @@ -548,12 +548,12 @@ test "switch prongs with cases with identical payload types" { | ... | @@ -548,12 +548,12 @@ test "switch prongs with cases with identical payload types" { |
| 548 | fn doTheSwitch1(u: Union) !void { | 548 | fn doTheSwitch1(u: Union) !void { |
| 549 | switch (u) { | 549 | switch (u) { |
| 550 | .A, .C => |e| { | 550 | .A, .C => |e| { |
| 551 | try expect(@TypeOf(e) == usize); | 551 | comptime assert(@TypeOf(e) == usize); |
| 552 | try expect(e == 8); | 552 | try expect(e == 8); |
| 553 | }, | 553 | }, |
| 554 | .B => |e| { | 554 | .B => |e| { |
| 555 | _ = e; | 555 | _ = e; |
| 556 | @panic("fail"); | 556 | return error.TestFailed; |
| 557 | }, | 557 | }, |
| 558 | } | 558 | } |
| 559 | } | 559 | } |
| ... | @@ -561,10 +561,10 @@ test "switch prongs with cases with identical payload types" { | ... | @@ -561,10 +561,10 @@ test "switch prongs with cases with identical payload types" { |
| 561 | switch (u) { | 561 | switch (u) { |
| 562 | .A, .C => |e| { | 562 | .A, .C => |e| { |
| 563 | _ = e; | 563 | _ = e; |
| 564 | @panic("fail"); | 564 | return error.TestFailed; |
| 565 | }, | 565 | }, |
| 566 | .B => |e| { | 566 | .B => |e| { |
| 567 | try expect(@TypeOf(e) == isize); | 567 | comptime assert(@TypeOf(e) == isize); |
| 568 | try expect(e == -8); | 568 | try expect(e == -8); |
| 569 | }, | 569 | }, |
| 570 | } | 570 | } |