19
internal/fingerprint/fingerprint_test.go
Normal file
19
internal/fingerprint/fingerprint_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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.
|
||||
}
|
Reference in New Issue
Block a user