Add enforce.Guard port with X11 and no-op adapters

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-01 12:33:02 -04:00
parent d0e6893659
commit 7fdcae5d14
5 changed files with 108 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
package enforce
import "testing"
// NewGuard must return a usable Guard on every platform (real on linux, no-op
// elsewhere). We assert non-nil only: calling MinimizeActive here would touch a
// real X server on linux, which the integration test covers under a DISPLAY
// guard. The behavioural contract is exercised in the session package via a fake
// Guard.
func TestNewGuardReturnsUsableGuard(t *testing.T) {
if g := NewGuard(); g == nil {
t.Fatal("NewGuard returned nil")
}
}