AtlatestRepositorysigil-ui

sigil-ui / tree / testtest-wayland.sgl

1;;; (sigil ui wayland) without a compositor. The tests that show surfaces
2;;; start their own headless compositor: test/wayland/run.
3
4(import (sigil test) (sigil process) (sigil string) (sigil ui wayland))
5
6(define (error-text thunk)
7 (guard (e (#t (if (error-object? e) (error-object-message e) "?")))
8 (thunk)
9 #f))
11(test-group "wayland"
12 (test "a role other than toplevel or fullscreen is refused before connecting"
13 (let ((m (error-text (lambda () (open-wayland-surface role: 'popup display: "unused")))))
14 (assert-true (string? m))
15 (assert-true (string-contains? m "toplevel or fullscreen"))))
17 (test "a display that is not there is an error naming the problem"
18 ;; Either the library is missing or the socket is: both say so.
19 (let ((m (error-text (lambda () (open-wayland-surface display: "sigil-ui-test-no-such-display")))))
20 (assert-true (string? m))
21 (assert-true (string-starts-with? m "wayland-open: ")))))