From 4af3830bb553465f52517ab6a629765c9b4fd42c Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Thu, 8 Jan 2026 16:05:20 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 변경된 API에 맞게 테스트 수정 --- test/core/engine/progress_loop_test.dart | 10 +++++++--- test/features/game_play_screen_test.dart | 10 +++++++--- test/features/game_session_controller_test.dart | 14 +++++++++----- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/test/core/engine/progress_loop_test.dart b/test/core/engine/progress_loop_test.dart index 6082fdd..f937383 100644 --- a/test/core/engine/progress_loop_test.dart +++ b/test/core/engine/progress_loop_test.dart @@ -13,14 +13,18 @@ class _FakeSaveManager implements SaveManager { final List savedStates = []; @override - Future saveState(GameState state, {String? fileName}) async { + Future saveState( + GameState state, { + String? fileName, + bool cheatsEnabled = false, + }) async { savedStates.add(state); return const SaveOutcome.success(); } @override - Future<(SaveOutcome, GameState?)> loadState({String? fileName}) async { - return (const SaveOutcome.success(), null); + Future<(SaveOutcome, GameState?, bool)> loadState({String? fileName}) async { + return (const SaveOutcome.success(), null, false); } @override diff --git a/test/features/game_play_screen_test.dart b/test/features/game_play_screen_test.dart index 46034bb..ba8a1cf 100644 --- a/test/features/game_play_screen_test.dart +++ b/test/features/game_play_screen_test.dart @@ -23,13 +23,17 @@ Widget _buildTestApp(Widget child) { class _FakeSaveManager implements SaveManager { @override - Future saveState(GameState state, {String? fileName}) async { + Future saveState( + GameState state, { + String? fileName, + bool cheatsEnabled = false, + }) async { return const SaveOutcome.success(); } @override - Future<(SaveOutcome, GameState?)> loadState({String? fileName}) async { - return (const SaveOutcome.success(), null); + Future<(SaveOutcome, GameState?, bool)> loadState({String? fileName}) async { + return (const SaveOutcome.success(), null, false); } @override diff --git a/test/features/game_session_controller_test.dart b/test/features/game_session_controller_test.dart index 39b8c99..69df17c 100644 --- a/test/features/game_session_controller_test.dart +++ b/test/features/game_session_controller_test.dart @@ -12,21 +12,25 @@ import 'package:flutter_test/flutter_test.dart'; class FakeSaveManager implements SaveManager { final List savedStates = []; - (SaveOutcome, GameState?) Function(String?)? onLoad; + (SaveOutcome, GameState?, bool) Function(String?)? onLoad; SaveOutcome saveOutcome = const SaveOutcome.success(); @override - Future saveState(GameState state, {String? fileName}) async { + Future saveState( + GameState state, { + String? fileName, + bool cheatsEnabled = false, + }) async { savedStates.add(state); return saveOutcome; } @override - Future<(SaveOutcome, GameState?)> loadState({String? fileName}) async { + Future<(SaveOutcome, GameState?, bool)> loadState({String? fileName}) async { if (onLoad != null) { return onLoad!(fileName); } - return (const SaveOutcome.success(), null); + return (const SaveOutcome.success(), null, false); } @override @@ -122,7 +126,7 @@ void main() { test('loadAndStart surfaces save load errors', () { fakeAsync((async) { final saveManager = FakeSaveManager() - ..onLoad = (_) => (const SaveOutcome.failure('boom'), null); + ..onLoad = (_) => (const SaveOutcome.failure('boom'), null, false); final controller = buildController(async, saveManager); controller.loadAndStart(fileName: 'bad.pqf');