internal/wayland: reimplement connect/bind code
All checks were successful
Test / Create distribution (push) Successful in 36s
Test / Sandbox (push) Successful in 2m13s
Test / Hakurei (push) Successful in 3m18s
Test / Hpkg (push) Successful in 4m9s
Test / Sandbox (race detector) (push) Successful in 4m14s
Test / Hakurei (race detector) (push) Successful in 5m7s
Test / Flake checks (push) Successful in 1m26s

The old implementation is relocated to system/wayland/deprecated.go.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-11-16 01:23:16 +09:00
parent fe40af7b7e
commit 61972d61f6
10 changed files with 254 additions and 267 deletions

View File

@@ -1,6 +1,7 @@
package wayland_test
import (
"os"
"syscall"
"testing"
@@ -58,6 +59,25 @@ func TestError(t *testing.T) {
Cause: wayland.RSocket,
}, "socket operation failed"},
{"host create", wayland.Error{
Cause: wayland.RHostCreate,
}, "cannot ensure wayland pathname socket"},
{"host create path", wayland.Error{
Cause: wayland.RHostCreate,
Errno: &os.PathError{Op: "create", Path: "/proc/nonexistent", Err: syscall.EEXIST},
}, "create /proc/nonexistent: file exists"},
{"host socket", wayland.Error{
Cause: wayland.RHostSocket,
Errno: stub.UniqueError(5),
}, "socket for host wayland server: unique error 5 injected by the test suite"},
{"host connect", wayland.Error{
Cause: wayland.RHostConnect,
Errno: stub.UniqueError(6),
}, "connect to host wayland server: unique error 6 injected by the test suite"},
{"invalid", wayland.Error{
Cause: 0xbad,
}, "impossible outcome"},