mirror of
https://codeberg.org/ziglings/exercises.git
synced 2025-11-05 05:05:36 +00:00
Update for new zig IO
`test/tests.zig` fails after https://github.com/ziglang/zig/pull/25592 was merged in. This just ensures that Io is passed, it might not be the ideal solution. `build.zig` was also failing due to new color parameter.
This commit is contained in:
parent
7ad02b084f
commit
26fc4fdaaa
|
|
@ -570,12 +570,12 @@ const ZiglingStep = struct {
|
||||||
|
|
||||||
// Render compile errors at the bottom of the terminal.
|
// Render compile errors at the bottom of the terminal.
|
||||||
// TODO: use the same ttyconf from the builder.
|
// TODO: use the same ttyconf from the builder.
|
||||||
const ttyconf: std.Io.tty.Config = if (use_color_escapes)
|
const color: std.zig.Color = if (use_color_escapes)
|
||||||
.escape_codes
|
.on
|
||||||
else
|
else
|
||||||
.no_color;
|
.off;
|
||||||
if (self.step.result_error_bundle.errorMessageCount() > 0) {
|
if (self.step.result_error_bundle.errorMessageCount() > 0) {
|
||||||
self.step.result_error_bundle.renderToStdErr(.{ .ttyconf = ttyconf });
|
self.step.result_error_bundle.renderToStdErr(.{}, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,9 @@ const CheckNamedStep = struct {
|
||||||
);
|
);
|
||||||
defer stderr_file.close();
|
defer stderr_file.close();
|
||||||
|
|
||||||
var stderr = stderr_file.readerStreaming(&.{});
|
var threaded: std.Io.Threaded = .init_single_threaded;
|
||||||
|
const io = threaded.io();
|
||||||
|
var stderr = stderr_file.readerStreaming(io, &.{});
|
||||||
{
|
{
|
||||||
// Skip the logo.
|
// Skip the logo.
|
||||||
const nlines = mem.count(u8, root.logo, "\n");
|
const nlines = mem.count(u8, root.logo, "\n");
|
||||||
|
|
@ -213,7 +215,9 @@ const CheckStep = struct {
|
||||||
);
|
);
|
||||||
defer stderr_file.close();
|
defer stderr_file.close();
|
||||||
|
|
||||||
var stderr = stderr_file.readerStreaming(&.{});
|
var threaded: std.Io.Threaded = .init_single_threaded;
|
||||||
|
const io = threaded.io();
|
||||||
|
var stderr = stderr_file.readerStreaming(io, &.{});
|
||||||
for (exercises) |ex| {
|
for (exercises) |ex| {
|
||||||
if (ex.number() == 1) {
|
if (ex.number() == 1) {
|
||||||
// Skip the logo.
|
// Skip the logo.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user