mirror of
https://github.com/yibaiba/hideck.git
synced 2026-12-05 16:02:17 +00:00
30 lines
615 B
Go
30 lines
615 B
Go
package e911
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/yibaiba/hideck/internal/modem"
|
|
)
|
|
|
|
func TestSetupAvailableUsesNativePLMN(t *testing.T) {
|
|
status := modem.DeviceStatus{
|
|
IMSI: "999990000000001",
|
|
NativeMCC: "310",
|
|
NativeMNC: "280",
|
|
}
|
|
if !SetupAvailable(status) {
|
|
t.Fatal("SetupAvailable=false, want true for native 310/280")
|
|
}
|
|
}
|
|
|
|
func TestSetupAvailableRejectsUnsupportedCarrier(t *testing.T) {
|
|
status := modem.DeviceStatus{
|
|
IMSI: "460001234567890",
|
|
NativeMCC: "460",
|
|
NativeMNC: "00",
|
|
}
|
|
if SetupAvailable(status) {
|
|
t.Fatal("SetupAvailable=true, want false for unsupported carrier")
|
|
}
|
|
}
|