diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..f30ff4d --- /dev/null +++ b/test.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +. src/helpers.sh + +NAME="$(getPrimaryInterfaceName)" +echo $NAME + +DNSSTRING=$(getDNS "$(networksetup -getdnsservers "$NAME")") +echo $DNSSTRING diff --git a/tests/apTests.bats b/tests/apTests.bats index 2d50600..016ac4b 100644 --- a/tests/apTests.bats +++ b/tests/apTests.bats @@ -136,7 +136,6 @@ load variables [ "${ARRAY[6]}" == $ICON_WIFI_LOCK ] } - @test "getAPDetails: active BSSID can contain starting zeros" { INPUT=" New AP 50:0d:0f:56:00:2e -54 132,+1 Y DK WPA2(PSK/AES/AES) " @@ -148,6 +147,15 @@ load variables [ "${ARRAY[6]}" == $ICON_WIFI_ACTIVE ] } +@test "getAPDetails: filter empty SSIDs" { + INPUT=" 50:0d:0f:56:00:2e -54 132,+1 Y DK WPA2(PSK/AES/AES) " + + run getAPDetails "$INPUT" + IFS='~' read -r -a ARRAY <<< "$output" + + [ "${#ARRAY[@]}" == 0 ] +} + @test "getAPDetails: favorited AP is marked with an icon" { INPUT=" New AP 50:1d:bf:56:2f:2e -54 132,+1 Y DK WPA2(PSK/AES/AES) " AP_LIST="New AP