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 {
413413 var this_unit_offset: u64 = 0;
414414
415415 while (this_unit_offset < try seekable.getEndPos()) {
416 seekable.seekTo(this_unit_offset) catch |err| switch (err) {
417 error.EndOfStream => unreachable,
418 else => return err,
419 };
416 try seekable.seekTo(this_unit_offset);
420417
421418 var is_64: bool = undefined;
422419 const unit_length = try readUnitLength(in, di.endian, &is_64);
......@@ -520,10 +517,7 @@ pub const DwarfInfo = struct {
520517 var this_unit_offset: u64 = 0;
521518
522519 while (this_unit_offset < try seekable.getEndPos()) {
523 seekable.seekTo(this_unit_offset) catch |err| switch (err) {
524 error.EndOfStream => unreachable,
525 else => return err,
526 };
520 try seekable.seekTo(this_unit_offset);
527521
528522 var is_64: bool = undefined;
529523 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" {
742742 const Data = union(Type) {
743743 no_op: void,
744744
745 pub fn decode(buf: []const u8) !Data {
745 pub fn decode(buf: []const u8) Data {
746746 return @unionInit(Data, "no_op", {});
747747 }
748748 };
......@@ -753,7 +753,7 @@ test "@unionInit on union w/ tag but no fields" {
753753
754754 fn doTheTest() void {
755755 var data: Data = .{ .no_op = .{} };
756 var o = try Data.decode(&[_]u8{});
756 var o = Data.decode(&[_]u8{});
757757 expectEqual(Type.no_op, o);
758758 }
759759 };