Files
findos/internal/fingerprint/fingerprint_test.go
Dev 4d51c65060
Some checks failed
Go CI / test (push) Has been cancelled
up
2025-09-13 12:30:01 +03:00

20 lines
569 B
Go

package fingerprint
import "testing"
// TestFingerprint_Basic ensures the Fingerprint function executes without error
// and returns a Result with the default OS placeholder.
func TestFingerprint_Basic(t *testing.T) {
res, err := Fingerprint("127.0.0.1")
if err != nil {
t.Fatalf("Fingerprint returned error: %v", err)
}
if res == nil {
t.Fatalf("Fingerprint returned nil result")
}
if res.OS != "Unknown" {
t.Fatalf("Expected OS to be 'Unknown', got %s", res.OS)
}
// The test does not require any open ports; an empty OpenPorts slice is acceptable.
}