package runner import ( "encoding/hex" "testing" ) func TestNewRunner_InitializesFields(t *testing.T) { r := New("http://localhost:8080", "runner-a", "host-a", false) if r == nil { t.Fatal("New should return a runner") } if r.name != "runner-a" || r.hostname != "host-a" { t.Fatalf("unexpected runner identity: %q %q", r.name, r.hostname) } } func TestRunner_GPUFlagsSetters(t *testing.T) { r := New("http://localhost:8080", "runner-a", "host-a", false) r.SetGPULockedOut(true) if !r.IsGPULockedOut() { t.Fatal("expected GPU lockout to be true") } } func TestGenerateFingerprint_PopulatesValue(t *testing.T) { r := New("http://localhost:8080", "runner-a", "host-a", false) r.generateFingerprint() fp := r.GetFingerprint() if fp == "" { t.Fatal("fingerprint should not be empty") } if len(fp) != 64 { t.Fatalf("fingerprint should be sha256 hex, got %q", fp) } if _, err := hex.DecodeString(fp); err != nil { t.Fatalf("fingerprint should be valid hex: %v", err) } }