diff --git a/src/zpinner.zig b/src/zpinner.zig index 9d51cf1..b9086f2 100644 --- a/src/zpinner.zig +++ b/src/zpinner.zig @@ -118,3 +118,39 @@ const Zpinner = struct { } } }; + +test "empty options struct contains default delay value" { + const expectedValue = std.time.ns_per_s * 0.1; + + const defaultOptions = Options{}; + + try std.testing.expectEqual(@as(u64, defaultOptions.delay), @as(u64, expectedValue)); +} +test "empty options struct contains default snake charset" { + const expectedValue = chars.Snake; + + const opts = Options{}; + + try std.testing.expectEqual(opts.chars, expectedValue); +} +test "empty options struct contains default empty prefix" { + const expectedValue = ""; + + const opts = Options{}; + + try std.testing.expectEqual(opts.prefix, expectedValue); +} +test "empty options struct contains default empty suffix" { + const expectedValue = ""; + + const opts = Options{}; + + try std.testing.expectEqual(opts.suffix, expectedValue); +} +test "empty options struct contains default style default" { + const expectedValue = Style{ .foreground = Color.Default, .background = Color.Default }; + + const opts = Options{}; + + try std.testing.expectEqual(opts.style, expectedValue); +}