You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1.1 KiB
30 lines
1.1 KiB
import 'package:eaimar/devices/smartcar/smartcar_link.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
group('isAllowedSmartcarName —— 车载香薰广播名准入', () {
|
|
test('规定的名字放行', () {
|
|
expect(isAllowedSmartcarName('EaiCar'), isTrue);
|
|
expect(isAllowedSmartcarName(' eaicar '), isTrue);
|
|
expect(isAllowedSmartcarName('EAICAR-3F2A'), isTrue);
|
|
});
|
|
|
|
// ⚠️ 旧广播名不再接纳。厂商 ID(0x8505) 也不再单独放行——它只说明
|
|
// "这是云衍方案的设备",说明不了"这是我们的正式产品"。
|
|
test('旧名 Smartcar 一律拒绝', () {
|
|
expect(isAllowedSmartcarName('Smartcar'), isFalse);
|
|
expect(isAllowedSmartcarName('smartcar'), isFalse);
|
|
expect(isAllowedSmartcarName('SmartcarX'), isFalse);
|
|
});
|
|
|
|
test('空名字拒绝', () {
|
|
expect(isAllowedSmartcarName(''), isFalse);
|
|
expect(isAllowedSmartcarName(' '), isFalse);
|
|
});
|
|
|
|
test('别家设备拒绝', () {
|
|
expect(isAllowedSmartcarName('EaiRec'), isFalse);
|
|
expect(isAllowedSmartcarName('Echo-one'), isFalse);
|
|
});
|
|
});
|
|
}
|
|
|