Zig 0.17.0-dev (Split by item)
This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig library itself.
Zig › std/ › time/ › epoch.zig › testEpoch
testEpoch
epoch.testEpoch
fn testEpoch (secs : u64 , expected_year_day : YearAndDay , expected_month_day : MonthAndDay , expected_day_seconds : struct
File
Code
fn testEpoch (secs : u64 , expected_year_day : YearAndDay , expected_month_day : MonthAndDay , expected_day_seconds : struct {
hours_into_day : u5 ,
minutes_into_hour : u6 ,
seconds_into_minute : u6 ,
}) !void {
const epoch_seconds = EpochSeconds { .secs = secs };
const epoch_day = epoch_seconds .getEpochDay ();
const day_seconds = epoch_seconds .getDaySeconds ();
const year_day = epoch_day .calculateYearDay ();
try testing .expectEqual (expected_year_day , year_day );
try testing .expectEqual (expected_month_day , year_day .calculateMonthDay ());
try testing .expectEqual (expected_day_seconds .hours_into_day , day_seconds .getHoursIntoDay ());
try testing .expectEqual (expected_day_seconds .minutes_into_hour , day_seconds .getMinutesIntoHour ());
try testing .expectEqual (expected_day_seconds .seconds_into_minute , day_seconds .getSecondsIntoMinute ());
}