Luce packages
LuceLuce BaseLuciaOS

dymokomi/luce-window

Source of release 0.6.2

0.6.2 / tests / programs / native_window / unsupported.lucb

from luce_window import window

## Unsupported targets can import the API and receive its ordinary error without
## linking any native window-system library. No macOS test helpers are imported.
pub func main(arguments: str[]) -> i32!:
    _ = arguments
    assert(not window.supported())
    var rejected = false
    var surface = window.Window.open() catch failure:
        assert(failure.code == window.unsupported)
        rejected = true
        var empty: window.Window
        recover empty
    surface.destroy()
    assert(rejected)
    print("ok unsupported window target")
    return 0