mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 10:46:57 -07:00
add basic ParseTargets test
Note: needs refactoring to include an actual alias map example. I was unable to get this to work for the time being, but this test adds at least some coverage.
This commit is contained in:
parent
0910c1ed0e
commit
b188354c33
1 changed files with 14 additions and 0 deletions
|
@ -32,3 +32,17 @@ func TestNormalizeMac(t *testing.T) {
|
|||
t.Fatalf("expected '%s', got '%s'", exp, got)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: refactor to parse targets with an actual alias map
|
||||
func TestParseTargets(t *testing.T) {
|
||||
ips, macs, err := ParseTargets("192.168.1.2, 192.168.1.3", &Aliases{})
|
||||
if err != nil {
|
||||
t.Error("ips:", ips, "macs:", macs, "err:", err)
|
||||
}
|
||||
if len(ips) != 2 {
|
||||
t.Fatalf("expected '%d', got '%d'", 2, len(ips))
|
||||
}
|
||||
if len(macs) != 0 {
|
||||
t.Fatalf("expected '%d', got '%d'", 0, len(macs))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue