package blender import "testing" func TestIsDRMCardNode(t *testing.T) { tests := map[string]bool{ "card0": true, "card12": true, "card": false, "card0-DP-1": false, "renderD128": false, "foo": false, } for in, want := range tests { if got := isDRMCardNode(in); got != want { t.Fatalf("isDRMCardNode(%q) = %v, want %v", in, got, want) } } } func TestIsGPUControllerLine(t *testing.T) { if !isGPUControllerLine("vga compatible controller: nvidia corp") { t.Fatal("expected VGA controller line to match") } if !isGPUControllerLine("3d controller: amd") { t.Fatal("expected 3d controller line to match") } if isGPUControllerLine("audio device: something") { t.Fatal("audio line should not match") } }