const std = @import("std");
const Pugh = @import("pugh.zig").Pugh;
const DEFAULT_SKIP_SIZE = 4;
test "Pugh" {
const KeyType = usize;
const SL = Pugh(KeyType, void, {}, comptime std.sort.asc(KeyType));
var sl = try SL.init(std.testing.allocator, DEFAULT_SKIP_SIZE, 16);
defer sl.deinit();
try sl.insert(3, {});
try sl.insert(6, {});
try sl.insert(7, {});
try sl.insert(9, {});
try sl.insert(0, {});
try sl.insert(std.math.minInt(KeyType), {});
try sl.insert(12, {});
try sl.insert(12, {}); // does nothing
try sl.insert(12, {}); // does nothing
try sl.insert(19, {});
try sl.insert(17, {});
try sl.insert(26, {});
try sl.insert(21, {});
try sl.insert(25, {});
sl.display();
try std.testing.expectEqual(@as(KeyType, 12), sl.search(12).?.key.?);
try std.testing.expectEqual(@as(KeyType, 26), sl.search(26).?.key.?);
try std.testing.expectEqual(@as(?*SL.Node, null), sl.search(13));
try std.testing.expectEqual(true, try sl.remove(12));
try std.testing.expectEqual(false, try sl.remove(12));
_ = try sl.remove(std.math.minInt(KeyType));
}