High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
test(bridge): keep the !windows cleanup test beside its tagged implementation
Darshan Jain231a2e87ce0b
diff --git a/internal/bridge/bridge_cleanup_test.go b/internal/bridge/bridge_cleanup_test.goindex e18857f5..47bc2e26 100644--- a/internal/bridge/bridge_cleanup_test.go+++ b/internal/bridge/bridge_cleanup_test.go@@ -195,20 +195,6 @@ func TestCleanup_CloakTermBeforeKill(t *testing.T) {}}-func TestCmdlineHasExactUserDataDirArgAvoidsPrefixCollision(t *testing.T) {- args := [][]byte{- []byte("/Applications/Chrome"),- []byte("--user-data-dir=/var/lib/pt/profile10"),- []byte("--remote-debugging-port=9222"),- }- if cmdlineHasExactArg(args, "--user-data-dir=/var/lib/pt/profile1") {- t.Fatal("profile1 matched profile10")- }- if !cmdlineHasExactArg(args, "--user-data-dir=/var/lib/pt/profile10") {- t.Fatal("profile10 should match exact user-data-dir arg")- }-}-func TestCleanup_RemoteCDP_SkipsKillLogic(t *testing.T) {withShortenedGrace(t, 20*time.Millisecond, 20*time.Millisecond)termCount, killCount := withMockedProcessLookup(t, func() []int { return []int{1} })diff --git a/internal/bridge/cleanup_unix_test.go b/internal/bridge/cleanup_unix_test.gonew file mode 100644index 00000000..6c19e205--- /dev/null+++ b/internal/bridge/cleanup_unix_test.go@@ -0,0 +1,22 @@+//go:build !windows++package bridge++import "testing"++// cmdlineHasExactArg lives in cleanup.go, which is //go:build !windows. Keeping its+// test beside the tagged implementation is what stops `go vet ./...` and the package+// test binary from failing to build on Windows.+func TestCmdlineHasExactUserDataDirArgAvoidsPrefixCollision(t *testing.T) {+ args := [][]byte{+ []byte("/Applications/Chrome"),+ []byte("--user-data-dir=/var/lib/pt/profile10"),+ []byte("--remote-debugging-port=9222"),+ }+ if cmdlineHasExactArg(args, "--user-data-dir=/var/lib/pt/profile1") {+ t.Fatal("profile1 matched profile10")+ }+ if !cmdlineHasExactArg(args, "--user-data-dir=/var/lib/pt/profile10") {+ t.Fatal("profile10 should match exact user-data-dir arg")+ }+}