Skip to content

Commit

Permalink
fix: support nightly build
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanaasagi committed Dec 3, 2023
1 parent 21c75d7 commit 12b7f88
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ansi.zig
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,15 @@ pub const Style = struct {

test "test to ansi" {
const style = .{ .bold = true, .fg = .green, .bg = .red };

var buf = try testing.allocator.alloc(u8, 32);
const buf = try testing.allocator.alloc(u8, 32);
defer testing.allocator.free(buf);
const res = try Style.toAnsi(style, buf);
try testing.expect(std.mem.eql(u8, res, "\x1b[32;41;1m"));
}

test "test default" {
const style = .{};
var buf = try testing.allocator.alloc(u8, 32);
const buf = try testing.allocator.alloc(u8, 32);
defer testing.allocator.free(buf);
const res = try Style.toAnsi(style, buf);
try testing.expect(std.mem.eql(u8, res, "\x1b[39;49m"));
Expand Down

0 comments on commit 12b7f88

Please sign in to comment.