aboutsummaryrefslogtreecommitdiff
path: root/lib/std/testing.zig
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2023-05-21 14:27:28 +0100
committerLinus Groh <mail@linusgroh.de>2023-05-24 10:15:02 +0100
commit0f6fa3f20b3b28958921bd63a9a9d96468455e9c (patch)
treeb725c368b43701903b4fe145eb240bfffbdc79e6 /lib/std/testing.zig
parent39c2eee285f820282dedba4404cac1009a5ae2d6 (diff)
downloadzig-0f6fa3f20b3b28958921bd63a9a9d96468455e9c.tar.gz
zig-0f6fa3f20b3b28958921bd63a9a9d96468455e9c.zip
std: Move std.debug.{TTY.Config,detectTTYConfig} to std.io.tty
Also get rid of the TTY wrapper struct, which was exlusively used as a namespace - this is done by the tty.zig root struct now. detectTTYConfig has been renamed to just detectConfig, which is enough given the new namespace. Additionally, a doc comment had been added.
Diffstat (limited to 'lib/std/testing.zig')
-rw-r--r--lib/std/testing.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig
index 8576ec0c83..7986c50eaf 100644
--- a/lib/std/testing.zig
+++ b/lib/std/testing.zig
@@ -279,7 +279,7 @@ test "expectApproxEqRel" {
/// This function is intended to be used only in tests. When the two slices are not
/// equal, prints diagnostics to stderr to show exactly how they are not equal (with
/// the differences highlighted in red), then returns a test failure error.
-/// The colorized output is optional and controlled by the return of `std.debug.detectTTYConfig()`.
+/// The colorized output is optional and controlled by the return of `std.io.tty.detectConfig()`.
/// If your inputs are UTF-8 encoded strings, consider calling `expectEqualStrings` instead.
pub fn expectEqualSlices(comptime T: type, expected: []const T, actual: []const T) !void {
if (expected.ptr == actual.ptr and expected.len == actual.len) {
@@ -312,7 +312,7 @@ pub fn expectEqualSlices(comptime T: type, expected: []const T, actual: []const
const actual_window = actual[window_start..@min(actual.len, window_start + max_window_size)];
const actual_truncated = window_start + actual_window.len < actual.len;
- const ttyconf = std.debug.detectTTYConfig(std.io.getStdErr());
+ const ttyconf = std.io.tty.detectConfig(std.io.getStdErr());
var differ = if (T == u8) BytesDiffer{
.expected = expected_window,
.actual = actual_window,
@@ -379,7 +379,7 @@ fn SliceDiffer(comptime T: type) type {
start_index: usize,
expected: []const T,
actual: []const T,
- ttyconf: std.debug.TTY.Config,
+ ttyconf: std.io.tty.Config,
const Self = @This();
@@ -398,7 +398,7 @@ fn SliceDiffer(comptime T: type) type {
const BytesDiffer = struct {
expected: []const u8,
actual: []const u8,
- ttyconf: std.debug.TTY.Config,
+ ttyconf: std.io.tty.Config,
pub fn write(self: BytesDiffer, writer: anytype) !void {
var expected_iterator = ChunkIterator{ .bytes = self.expected };