testutil

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testutil provides test utilities and mock implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempDir

func CreateTempDir(t *testing.T) string

CreateTempDir creates a temporary directory for testing

func CreateTestSMWFile

func CreateTestSMWFile(t *testing.T, dir string, name string) string

CreateTestSMWFile creates a minimal .smw file for testing

Types

type FindWindowCall

type FindWindowCall struct {
	TargetPid uint32
	Debug     bool
}

type MockProcessManager

type MockProcessManager struct {
	FindWindowResult   uintptr
	FindWindowTitle    string
	WaitForReadyResult bool
	FindWindowCalls    []FindWindowCall
	// contains filtered or unexported fields
}

MockProcessManager implements interfaces.ProcessManager for testing

func NewMockProcessManager

func NewMockProcessManager() *MockProcessManager

func (*MockProcessManager) FindWindow

func (m *MockProcessManager) FindWindow(targetPid uint32, debug bool) (uintptr, string)

func (*MockProcessManager) WaitForReady

func (m *MockProcessManager) WaitForReady(hwnd uintptr, timeout time.Duration) bool

func (*MockProcessManager) WithFindWindowResult

func (m *MockProcessManager) WithFindWindowResult(hwnd uintptr, title string) *MockProcessManager

Helper methods for fluent configuration

func (*MockProcessManager) WithPid

func (m *MockProcessManager) WithPid(pid uint32) *MockProcessManager

func (*MockProcessManager) WithWaitForReadyResult

func (m *MockProcessManager) WithWaitForReadyResult(result bool) *MockProcessManager

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL