From 42738688ec034ea2812ebf2a930970c88d9a4061 Mon Sep 17 00:00:00 2001 From: RyuJongJin <266630912+RyuJongJin@users.noreply.github.com> Date: Tue, 20 Oct 2026 13:28:35 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=ED=97=98:=20Wi-Fi=20=EA=B3=B5?= =?UTF-8?q?=EC=9C=A0=EB=A5=BC=20=EB=81=88=20=EB=92=A4=20(=EC=86=90?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=C2=B7=20=EC=A0=80=EC=A0=88=EB=A1=9C)=20?= =?UTF-8?q?=EA=B7=B8=20=ED=8F=AC=ED=8A=B8=EB=A1=9C=20=EB=8D=94=EB=8A=94=20?= =?UTF-8?q?=EC=95=88=20=EC=97=B4=EB=A6=BC=20=C2=B7=2016=EC=A7=84=20?= =?UTF-8?q?=EB=B3=B4=EA=B8=B0=20412=20=EB=8A=94=20=ED=95=9C=20=EC=A4=84=20?= =?UTF-8?q?8=EB=B0=94=EC=9D=B4=ED=8A=B8=20(=EA=B2=80=ED=86=A0=20=EB=8C=80?= =?UTF-8?q?=EA=B8=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 관리자 지시 (10/20) 2번 - 위키 974 목록에서 "🧪 ·" 만 적혀 있고 실제 시험이 없던 것: - 2절 "[끄기] → 다른 기기에서 더는 안 열림 · 30분이 지나면 저절로 꺼짐": 꺼진 것 (running) 만 보던 것을 그 포트에 실제로 연결해 막히는지까지 (손으로 끄기 · 저절로 꺼짐 둘 다). - 3절 "16진 - 폰 세로는 한 줄 8바이트": 412 폭은 둘째 줄이 00000008, 960 폭은 00000010. 글자 칸이 화면 안인지는 실제 글꼴이 필요해 Windows 캡처 (15) 몫 (시험 글꼴은 모든 글자가 정사각형). 코드 변경 없음 - 둘 다 통과. Co-Authored-By: Claude Opus 5.5 --- test/file_tools_test.dart | 23 +++++++++++++++++++++++ test/wifi_share_test.dart | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/test/file_tools_test.dart b/test/file_tools_test.dart index 2c70bec..87d54cb 100644 --- a/test/file_tools_test.dart +++ b/test/file_tools_test.dart @@ -3,6 +3,7 @@ import 'dart:io'; import 'package:flutter_test/flutter_test.dart'; import 'package:jj_mkvmaker/ui/file_tools.dart'; import 'package:path/path.dart' as p; +import 'package:flutter/material.dart'; /// X-plore 비교 P3: 해시 · 16진 보기 · 폴더 속성 void main() { @@ -27,4 +28,26 @@ void main() { final s = await folderStats(p.join(tmp.path, 'd')); expect((s.files, s.folders, s.bytes), (2, 1, 15)); }); + + testWidgets('위키 974 3절 (10/20): 16진 보기 - 폰 세로 (412) 는 한 줄 8바이트 · 넓으면 16바이트', (tester) async { + final dir = Directory.systemTemp.createTempSync('jj_hex_'); + addTearDown(() => dir.deleteSync(recursive: true)); + final f = File(p.join(dir.path, 'a.bin'))..writeAsBytesSync([for (var i = 0; i < 40; i++) 0x41 + i % 26]); + for (final (w, per) in [(412.0, 8), (960.0, 16)]) { + tester.view.physicalSize = Size(w, 800); + tester.view.devicePixelRatio = 1; + addTearDown(tester.view.reset); + await tester.pumpWidget(MaterialApp(key: ValueKey(w), home: HexViewerPage(path: f.path))); + // 파일은 진짜 입출력으로 읽는다 - 다 읽어 그릴 때까지 + for (var i = 0; i < 20 && find.textContaining(RegExp('^00000000 ')).evaluate().isEmpty; i++) { + await tester.runAsync(() => Future.delayed(const Duration(milliseconds: 50))); + await tester.pump(); + } + // 둘째 줄의 시작 자리 = per + final second = per.toRadixString(16).padLeft(8, '0'); + expect(find.textContaining(RegExp('^$second ')), findsOneWidget, reason: '$w 폭: 한 줄 $per 바이트'); + expect(tester.takeException(), isNull); + // 글자 칸까지 화면 안인지는 실제 글꼴로 - Windows 캡처 (15, 412 폭) 가 본다 (시험 글꼴은 모든 글자가 정사각형) + } + }); } diff --git a/test/wifi_share_test.dart b/test/wifi_share_test.dart index 286042e..bf5b886 100644 --- a/test/wifi_share_test.dart +++ b/test/wifi_share_test.dart @@ -201,4 +201,24 @@ void main() { expect(WifiShare.isLocalNetwork(ip), isFalse, reason: ip); } }); + + test('위키 974 2절 (10/20): [끄기] · 저절로 꺼진 뒤에는 그 주소 · 포트로 더는 열리지 않는다 (다른 기기에서 안 열림)', () async { + final port = s.port; + final ok = await Socket.connect('127.0.0.1', port); + ok.destroy(); + await s.stop(); + expect(s.running, isFalse); + await expectLater(Socket.connect('127.0.0.1', port, timeout: const Duration(seconds: 1)), throwsA(isA()), + reason: '[끄기] 뒤'); + final t = await WifiShare.start(shared.path, port: 0, autoOff: const Duration(milliseconds: 200), loopbackOnly: true); + s = t; + final port2 = t.port; + (await Socket.connect('127.0.0.1', port2)).destroy(); + for (var i = 0; i < 50 && t.running; i++) { + await Future.delayed(const Duration(milliseconds: 20)); + } + expect(t.running, isFalse); + await expectLater(Socket.connect('127.0.0.1', port2, timeout: const Duration(seconds: 1)), throwsA(isA()), + reason: '저절로 꺼진 뒤'); + }); }