From 79832406e242ead7c030214c3b02bda519eea37d Mon Sep 17 00:00:00 2001 From: "Nurul Huda (Apon)" Date: Wed, 11 Feb 2026 17:08:20 +0600 Subject: [PATCH] test: add all missing method tests --- src/Duration.zig | 52 +++++++++++++++ src/Instant.zig | 24 +++++++ src/PlainDate.zig | 72 +++++++++++++++++++++ src/PlainDateTime.zig | 96 +++++++++++++++++++++++++++ src/PlainMonthDay.zig | 16 +++++ src/PlainTime.zig | 32 +++++++++ src/PlainYearMonth.zig | 4 ++ src/ZonedDateTime.zig | 144 +++++++++++++++++++++++++++++++++++++++++ 8 files changed, 440 insertions(+) diff --git a/src/Duration.zig b/src/Duration.zig index 3d19fa2..7a4673a 100644 --- a/src/Duration.zig +++ b/src/Duration.zig @@ -604,3 +604,55 @@ test total { try std.testing.expectError(error.RangeError, dur.total(.{ .unit = .day })); } } + +test years { + if (true) return error.Todo; +} + +test months { + if (true) return error.Todo; +} + +test weeks { + if (true) return error.Todo; +} + +test days { + if (true) return error.Todo; +} + +test hours { + if (true) return error.Todo; +} + +test minutes { + if (true) return error.Todo; +} + +test seconds { + if (true) return error.Todo; +} + +test milliseconds { + if (true) return error.Todo; +} + +test microseconds { + if (true) return error.Todo; +} + +test nanoseconds { + if (true) return error.Todo; +} + +test sign { + if (true) return error.Todo; +} + +test toJSON { + if (true) return error.Todo; +} + +test toLocaleString { + if (true) return error.Todo; +} diff --git a/src/Instant.zig b/src/Instant.zig index dd70732..95c4f45 100644 --- a/src/Instant.zig +++ b/src/Instant.zig @@ -487,3 +487,27 @@ test toLocaleString { // Auto precision should include fractional seconds try std.testing.expect(std.mem.containsAtLeast(u8, locale_str2, 1, "2024-01-01T00:00:00")); } + +test fromEpochMilliseconds { + if (true) return error.Todo; +} + +test add { + if (true) return error.Todo; +} + +test toJSON { + if (true) return error.Todo; +} + +test toZonedDateTimeISO { + if (true) return error.Todo; +} + +test epochMilliseconds { + if (true) return error.Todo; +} + +test epochNanoseconds { + if (true) return error.Todo; +} diff --git a/src/PlainDate.zig b/src/PlainDate.zig index 2f8722c..5e72f46 100644 --- a/src/PlainDate.zig +++ b/src/PlainDate.zig @@ -534,3 +534,75 @@ test withCalendar { try std.testing.expectEqual(@as(i32, 2024), result.year()); } + +test calInit { + if (true) return error.Todo; +} + +test valueOf { + if (true) return error.Todo; +} + +test day { + if (true) return error.Todo; +} + +test dayOfWeek { + if (true) return error.Todo; +} + +test dayOfYear { + if (true) return error.Todo; +} + +test daysInMonth { + if (true) return error.Todo; +} + +test daysInWeek { + if (true) return error.Todo; +} + +test daysInYear { + if (true) return error.Todo; +} + +test monthCode { + if (true) return error.Todo; +} + +test month { + if (true) return error.Todo; +} + +test monthsInYear { + if (true) return error.Todo; +} + +test year { + if (true) return error.Todo; +} + +test inLeapYear { + if (true) return error.Todo; +} + +test calendarId { + if (true) return error.Todo; +} + +test era { + if (true) return error.Todo; +} + +test eraYear { + if (true) return error.Todo; +} + +test weekOfYear { + if (true) return error.Todo; +} + +test yearOfWeek { + if (true) return error.Todo; +} diff --git a/src/PlainDateTime.zig b/src/PlainDateTime.zig index 910952f..8c25b82 100644 --- a/src/PlainDateTime.zig +++ b/src/PlainDateTime.zig @@ -704,3 +704,99 @@ test withPlainTime { try std.testing.expectEqual(@as(u8, 15), result.minute()); try std.testing.expectEqual(@as(u8, 30), result.second()); } + +test calInit { + if (true) return error.Todo; +} + +test calendarId { + if (true) return error.Todo; +} + +test day { + if (true) return error.Todo; +} + +test dayOfWeek { + if (true) return error.Todo; +} + +test dayOfYear { + if (true) return error.Todo; +} + +test daysInMonth { + if (true) return error.Todo; +} + +test daysInWeek { + if (true) return error.Todo; +} + +test daysInYear { + if (true) return error.Todo; +} + +test month { + if (true) return error.Todo; +} + +test monthCode { + if (true) return error.Todo; +} + +test monthsInYear { + if (true) return error.Todo; +} + +test year { + if (true) return error.Todo; +} + +test inLeapYear { + if (true) return error.Todo; +} + +test era { + if (true) return error.Todo; +} + +test eraYear { + if (true) return error.Todo; +} + +test weekOfYear { + if (true) return error.Todo; +} + +test yearOfWeek { + if (true) return error.Todo; +} + +test hour { + if (true) return error.Todo; +} + +test minute { + if (true) return error.Todo; +} + +test second { + if (true) return error.Todo; +} + +test millisecond { + if (true) return error.Todo; +} + +test microsecond { + if (true) return error.Todo; +} + +test nanosecond { + if (true) return error.Todo; +} + +test valueOf { + if (true) return error.Todo; +} diff --git a/src/PlainMonthDay.zig b/src/PlainMonthDay.zig index b267ad6..75ba254 100644 --- a/src/PlainMonthDay.zig +++ b/src/PlainMonthDay.zig @@ -284,3 +284,19 @@ test toLocaleString { try std.testing.expect(str.len > 0); try std.testing.expect(std.mem.indexOf(u8, str, "12") != null or std.mem.indexOf(u8, str, "25") != null); } + +test calendarId { + if (true) return error.Todo; +} + +test day { + if (true) return error.Todo; +} + +test monthCode { + if (true) return error.Todo; +} + +test valueOf { + if (true) return error.Todo; +} diff --git a/src/PlainTime.zig b/src/PlainTime.zig index 5165701..27b549c 100644 --- a/src/PlainTime.zig +++ b/src/PlainTime.zig @@ -401,3 +401,35 @@ test until { try std.testing.expectEqual(@as(i64, 1), dur.hours()); try std.testing.expectEqual(@as(i64, 30), dur.minutes()); } + +test hour { + if (true) return error.Todo; +} + +test minute { + if (true) return error.Todo; +} + +test second { + if (true) return error.Todo; +} + +test millisecond { + if (true) return error.Todo; +} + +test microsecond { + if (true) return error.Todo; +} + +test nanosecond { + if (true) return error.Todo; +} + +test toLocaleString { + if (true) return error.Todo; +} + +test valueOf { + if (true) return error.Todo; +} diff --git a/src/PlainYearMonth.zig b/src/PlainYearMonth.zig index 8718ea1..b2fc9fa 100644 --- a/src/PlainYearMonth.zig +++ b/src/PlainYearMonth.zig @@ -491,3 +491,7 @@ test "props" { try std.testing.expect(false); } } + +test valueOf { + if (true) return error.Todo; +} diff --git a/src/ZonedDateTime.zig b/src/ZonedDateTime.zig index 4bf9780..6661c92 100644 --- a/src/ZonedDateTime.zig +++ b/src/ZonedDateTime.zig @@ -636,3 +636,147 @@ test "props" { defer std.testing.allocator.free(tzo); try std.testing.expectEqualStrings("UTC", tzo); } + +test fromEpochNanoseconds { + if (true) return error.Todo; +} + +test add { + if (true) return error.Todo; +} + +test getTimeZoneTransition { + if (true) return error.Todo; +} + +test round { + if (true) return error.Todo; +} + +test since { + if (true) return error.Todo; +} + +test startOfDay { + if (true) return error.Todo; +} + +test subtract { + if (true) return error.Todo; +} + +test toJSON { + if (true) return error.Todo; +} + +test toLocaleString { + if (true) return error.Todo; +} + +test until { + if (true) return error.Todo; +} + +test valueOf { + if (true) return error.Todo; +} + +test with { + if (true) return error.Todo; +} + +test withCalendar { + if (true) return error.Todo; +} + +test withPlainTime { + if (true) return error.Todo; +} + +test withTimeZone { + if (true) return error.Todo; +} + +test calendarId { + if (true) return error.Todo; +} + +test dayOfWeek { + if (true) return error.Todo; +} + +test dayOfYear { + if (true) return error.Todo; +} + +test daysInMonth { + if (true) return error.Todo; +} + +test daysInWeek { + if (true) return error.Todo; +} + +test daysInYear { + if (true) return error.Todo; +} + +test epochMilliseconds { + if (true) return error.Todo; +} + +test epochNanoseconds { + if (true) return error.Todo; +} + +test era { + if (true) return error.Todo; +} + +test eraYear { + if (true) return error.Todo; +} + +test hoursInDay { + if (true) return error.Todo; +} + +test inLeapYear { + if (true) return error.Todo; +} + +test microsecond { + if (true) return error.Todo; +} + +test monthCode { + if (true) return error.Todo; +} + +test monthsInYear { + if (true) return error.Todo; +} + +test nanosecond { + if (true) return error.Todo; +} + +test offset { + if (true) return error.Todo; +} + +test offsetNanoseconds { + if (true) return error.Todo; +} + +test weekOfYear { + if (true) return error.Todo; +} + +test yearOfWeek { + if (true) return error.Todo; +} + +test clone { + if (true) return error.Todo; +}