// 集成测试共享工具。 import 'package:web_socket_channel/io.dart'; /// 探测 Rtty 服务端是否可达;返回 false 时集成测试应被跳过。 Future isServerUp(String host, int port) async { try { final ws = IOWebSocketChannel.connect(Uri.parse('ws://$host:$port/ws')); await ws.ready.timeout(const Duration(seconds: 2)); ws.sink.close(); return true; } catch (_) { return false; } }