Skip to content

Commit

Permalink
std: Clean up some tests
Browse files Browse the repository at this point in the history
No functional changes, remove some dead code.
  • Loading branch information
LemonBoy committed Dec 29, 2020
1 parent ccf4122 commit 191d96a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions lib/std/dwarf.zig
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,7 @@ pub const DwarfInfo = struct {
var this_unit_offset: u64 = 0;

while (this_unit_offset < try seekable.getEndPos()) {
seekable.seekTo(this_unit_offset) catch |err| switch (err) {
error.EndOfStream => unreachable,
else => return err,
};
try seekable.seekTo(this_unit_offset);

var is_64: bool = undefined;
const unit_length = try readUnitLength(in, di.endian, &is_64);
Expand Down Expand Up @@ -520,10 +517,7 @@ pub const DwarfInfo = struct {
var this_unit_offset: u64 = 0;

while (this_unit_offset < try seekable.getEndPos()) {
seekable.seekTo(this_unit_offset) catch |err| switch (err) {
error.EndOfStream => unreachable,
else => return err,
};
try seekable.seekTo(this_unit_offset);

var is_64: bool = undefined;
const unit_length = try readUnitLength(in, di.endian, &is_64);
Expand Down
4 changes: 2 additions & 2 deletions test/stage1/behavior/union.zig
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ test "@unionInit on union w/ tag but no fields" {
const Data = union(Type) {
no_op: void,

pub fn decode(buf: []const u8) !Data {
pub fn decode(buf: []const u8) Data {
return @unionInit(Data, "no_op", {});
}
};
Expand All @@ -753,7 +753,7 @@ test "@unionInit on union w/ tag but no fields" {

fn doTheTest() void {
var data: Data = .{ .no_op = .{} };
var o = try Data.decode(&[_]u8{});
var o = Data.decode(&[_]u8{});
expectEqual(Type.no_op, o);
}
};
Expand Down

0 comments on commit 191d96a

Please sign in to comment.