aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruser <user@clank>2026-10-09 12:24:53 +0200
committeruser <user@clank>2026-10-09 12:31:53 +0200
commitd04228e9124eca3117843dfb5dfcf531d2107d07 (patch)
tree9aef18431aac96a4455a3f29b688915b546b28af
parentosc 7501: say what you are doing in somebody else's protocol (diff)
downloadslosh-d04228e9124eca3117843dfb5dfcf531d2107d07.tar.gz
slosh-d04228e9124eca3117843dfb5dfcf531d2107d07.tar.xz
slosh-d04228e9124eca3117843dfb5dfcf531d2107d07.zip
tests: clang-format and ruff catch up on two files
No behaviour: argument wrapping in path_test, and one check() call in test_mouse_pixels that was over the line length. Both are what the pre-commit hook would have done anyway.
-rw-r--r--tests/path_test.c18
-rw-r--r--tests/test_mouse_pixels.py6
2 files changed, 13 insertions, 11 deletions
diff --git a/tests/path_test.c b/tests/path_test.c
index 80c0396..1f14423 100644
--- a/tests/path_test.c
+++ b/tests/path_test.c
@@ -61,26 +61,23 @@ int main(void) {
eq("the directory of a nested path", path_dir("/a/b/c.kdl", buf, sizeof buf),
"/a/b");
eq("the name of a nested path", path_base("/a/b/c.kdl"), "c.kdl");
- eq("a bare name is in the current directory", path_dir("c.kdl", buf,
- sizeof buf),
- ".");
+ eq("a bare name is in the current directory",
+ path_dir("c.kdl", buf, sizeof buf), ".");
eq("and is its own name", path_base("c.kdl"), "c.kdl");
eq("a path at the root", path_dir("/c.kdl", buf, sizeof buf), "/");
eq("its name", path_base("/c.kdl"), "c.kdl");
#ifdef _WIN32
- eq("a backslash separates", path_dir("C:\\Users\\you\\config.kdl", buf,
- sizeof buf),
- "C:\\Users\\you");
+ eq("a backslash separates",
+ path_dir("C:\\Users\\you\\config.kdl", buf, sizeof buf), "C:\\Users\\you");
eq("and names", path_base("C:\\Users\\you\\config.kdl"), "config.kdl");
/* The mixture is not hypothetical: slosh joins with '/' and $HOME arrives
* with '\', so the default config path is spelled both ways at once. */
eq("the last separator wins in a mixed path",
path_dir("C:\\Users\\you/.config/slosh/config.kdl", buf, sizeof buf),
"C:\\Users\\you/.config/slosh");
- eq("and the other order", path_dir("C:/Users/you\\config.kdl", buf,
- sizeof buf),
- "C:/Users/you");
+ eq("and the other order",
+ path_dir("C:/Users/you\\config.kdl", buf, sizeof buf), "C:/Users/you");
/* `C:` alone is the current directory on drive C, which is somewhere else. */
eq("a file at a drive root keeps the separator",
path_dir("C:\\config.kdl", buf, sizeof buf), "C:\\");
@@ -98,7 +95,8 @@ int main(void) {
/* ---- resolving against a base ----------------------------------------- */
eq("a relative path joins the base",
- path_resolve("themes/t.kdl", "/cfg", buf, sizeof buf), "/cfg/themes/t.kdl");
+ path_resolve("themes/t.kdl", "/cfg", buf, sizeof buf),
+ "/cfg/themes/t.kdl");
eq("an absolute path ignores the base",
path_resolve("/etc/t.kdl", "/cfg", buf, sizeof buf), "/etc/t.kdl");
eq("no base leaves it alone",
diff --git a/tests/test_mouse_pixels.py b/tests/test_mouse_pixels.py
index c91df13..7572216 100644
--- a/tests/test_mouse_pixels.py
+++ b/tests/test_mouse_pixels.py
@@ -84,7 +84,11 @@ def test_cell_mode_is_unchanged():
s.settle(60)
out = s.snapshot().pane_text(p)
got = clicked(out)
- check("a plain SGR pane still gets cell coordinates", got == (want_x, want_y), repr(got))
+ check(
+ "a plain SGR pane still gets cell coordinates",
+ got == (want_x, want_y),
+ repr(got),
+ )
if __name__ == "__main__":