authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-12-29 13:00:01+01:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2020-12-30 09:42:21+01:00
log2561168adbe642287c1eccd73fc29576ff0216f3
treefb519eae876e4e4750283afc88b6eda1ca7203d2
parent88634f0481fb1bd78f8d018b76cab6590691c8a9

std: Clean up some tests

No functional changes, remove some dead code.

2 files changed, 4 insertions(+), 10 deletions(-)

lib/std/dwarf.zig+2-8
...@@ -413,10 +413,7 @@ pub const DwarfInfo = struct {...@@ -413,10 +413,7 @@ pub const DwarfInfo = struct {
413 var this_unit_offset: u64 = 0;413 var this_unit_offset: u64 = 0;
414414
415 while (this_unit_offset < try seekable.getEndPos()) {415 while (this_unit_offset < try seekable.getEndPos()) {
416 seekable.seekTo(this_unit_offset) catch |err| switch (err) {416 try seekable.seekTo(this_unit_offset);
417 error.EndOfStream => unreachable,
418 else => return err,
419 };
420417
421 var is_64: bool = undefined;418 var is_64: bool = undefined;
422 const unit_length = try readUnitLength(in, di.endian, &is_64);419 const unit_length = try readUnitLength(in, di.endian, &is_64);
...@@ -520,10 +517,7 @@ pub const DwarfInfo = struct {...@@ -520,10 +517,7 @@ pub const DwarfInfo = struct {
520 var this_unit_offset: u64 = 0;517 var this_unit_offset: u64 = 0;
521518
522 while (this_unit_offset < try seekable.getEndPos()) {519 while (this_unit_offset < try seekable.getEndPos()) {
523 seekable.seekTo(this_unit_offset) catch |err| switch (err) {520 try seekable.seekTo(this_unit_offset);
524 error.EndOfStream => unreachable,
525 else => return err,
526 };
527521
528 var is_64: bool = undefined;522 var is_64: bool = undefined;
529 const unit_length = try readUnitLength(in, di.endian, &is_64);523 const unit_length = try readUnitLength(in, di.endian, &is_64);
test/stage1/behavior/union.zig+2-2
...@@ -742,7 +742,7 @@ test "@unionInit on union w/ tag but no fields" {...@@ -742,7 +742,7 @@ test "@unionInit on union w/ tag but no fields" {
742 const Data = union(Type) {742 const Data = union(Type) {
743 no_op: void,743 no_op: void,
744744
745 pub fn decode(buf: []const u8) !Data {745 pub fn decode(buf: []const u8) Data {
746 return @unionInit(Data, "no_op", {});746 return @unionInit(Data, "no_op", {});
747 }747 }
748 };748 };
...@@ -753,7 +753,7 @@ test "@unionInit on union w/ tag but no fields" {...@@ -753,7 +753,7 @@ test "@unionInit on union w/ tag but no fields" {
753753
754 fn doTheTest() void {754 fn doTheTest() void {
755 var data: Data = .{ .no_op = .{} };755 var data: Data = .{ .no_op = .{} };
756 var o = try Data.decode(&[_]u8{});756 var o = Data.decode(&[_]u8{});
757 expectEqual(Type.no_op, o);757 expectEqual(Type.no_op, o);
758 }758 }
759 };759 };