Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
abu-usama committed Jul 30, 2023
1 parent a2cf8cb commit 86fa8c6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/portscan_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package tests

import (
"testing"

"pentest_tools/modules"
)

// Test scanPort function
func TestScanPort(t *testing.T) {
opts := modules.ScanOptions{Address: "google.com"}
if result := modules.ScanPorts(opts); result.Total != 1 || result.Ports[0] != 80 {
t.Errorf("Expected ScanPorts to return only port 80 to be open for %v", opts.Address)
}
}

0 comments on commit 86fa8c6

Please sign in to comment.