Update files

This commit is contained in:
Sprite committed 2026-11-19 10:03:28 +00:00
1 parent ca918a4a34
commit 3bdf874584
4 files changed
+146 -31

No files matched your search

+42
View File
@@ -170,3 +170,45 @@ test "visible_len and render_fetch no_color" {
assert_true(json_out.contains("\"username\": \"alice\""))
assert_true(json_out.contains("\"os\": \"Debian 12 x86_64\""))
}
///|
test "ubuntu logo multi-color and no_color" {
let info : @lib.SystemInfo = {
username: "alice",
hostname: "box",
os_id: "ubuntu",
os_name: "Ubuntu 26.04.1 LTS x86_64",
host_model: "KVM",
kernel: "Linux 6.12",
arch: "x86_64",
uptime: "10 mins",
uptime_secs: 600,
packages: "100 (dpkg)",
shell: "bash 5.2",
terminal: "xterm (80x24)",
de_wm: "Headless / TTY",
cpu: "Test CPU (4)",
memory: "1.00 GiB / 4.00 GiB (25%)",
mem_used_kib: 1048576UL,
mem_total_kib: 4194304UL,
disk: "2.00 GiB / 10.00 GiB (20%)",
disk_used_bytes: 2147483648UL,
disk_total_bytes: 10737418240UL,
local_ip: "10.0.0.2",
locale: "C.UTF-8",
}
let colored = @lib.render_fetch(
info,
@lib.parse_args(["--structure", "title"]),
)
assert_true(colored.contains("\u001b[1;31m"))
assert_true(colored.contains("\u001b[1;37m"))
assert_true(!colored.contains("$1") && !colored.contains("$2"))
let plain = @lib.render_fetch(
info,
@lib.parse_args(["--no-color", "--structure", "title"]),
)
assert_true(!plain.contains("\u001b["))
assert_true(!plain.contains("$1") && !plain.contains("$2"))
}