21 lines
689 B
Go
21 lines
689 B
Go
package server
|
|
|
|
import (
|
|
"git.mchus.pro/reanimator/parser/v31/models"
|
|
"testing"
|
|
)
|
|
|
|
func TestNormalizePCIeSerialComponentName_PrefersPartOverGenericClass(t *testing.T) {
|
|
got := normalizePCIeSerialComponentName(models.PCIeDevice{DeviceClass: "Display Controller", PartNumber: "GH100 [H200 NVL]"})
|
|
if got != "GH100 [H200 NVL]" {
|
|
t.Fatalf("expected part number, got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestNormalizePCIeSerialComponentName_UsesClassWhenSpecific(t *testing.T) {
|
|
got := normalizePCIeSerialComponentName(models.PCIeDevice{DeviceClass: "I350 Gigabit Network Connection", PartNumber: "I350T4V2"})
|
|
if got != "I350T4V2" {
|
|
t.Fatalf("expected part number for readability, got %q", got)
|
|
}
|
|
}
|