mirror of
https://github.com/ziglang/zig.git
synced 2026-01-05 04:53:17 +00:00
std: Clean up some tests
No functional changes, remove some dead code.
This commit is contained in:
parent
88634f0481
commit
2561168adb
@ -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);
|
||||
@ -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);
|
||||
|
||||
@ -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", {});
|
||||
}
|
||||
};
|
||||
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user