-
-
Notifications
You must be signed in to change notification settings - Fork 14
Testing
abduznik edited this page Jul 17, 2026
·
1 revision
Freegosy has 713 tests (as of v0.5.10-pre) covering unit logic, widget rendering, and integration scenarios.
flutter test # Full suite (~30s)
flutter test test/unit/ares_strategy_test.dart # Single file
flutter analyze # Lint check (no issues expected)| Directory | Purpose | File Count |
|---|---|---|
test/unit/ |
Pure logic tests | 42 files |
test/widgets/ |
Widget rendering tests | 6 files |
test/core/ |
Integration-level core logic | 5 files |
test/health/ |
Smoke checks | 1 file |
test/ (root) |
Edge cases, integration, verification | 4 files |
- flutter_test — core Flutter test framework
-
mockito — mock generation via
@GenerateMocksannotation -
build_runner — generates
.mocks.dartfiles from annotations - http_mock_adapter — HTTP/Dio request mocking
- fake_async — async timing control
- Built-in controller mappings validation
- POV decoding (8 cardinal + diagonal directions)
- SDL mapping parser
- Custom mapping persistence (round-trip, corrupt JSON, polarity-encoded keys)
- Deadzone config (defaults, persistence, per-controller overrides)
- PlayStation USB controller entries (PS4, PS5, PS5 Access, Sony ISE Wireless)
- Empty-token fallback for Bluetooth noise-only controller names
-
getSystemNameForSlug— correct mapping, case-insensitive, null handling -
supportedSlugs— matches all 30kAresSystemNameskeys -
Args regression — launch calls only pass
['--system', name], no--fullscreen/--no-file-prompt - Unsupported platform throws for both
launchandlaunchWithHandle
- Extension classification per platform (confirmed/defaulted/log-only)
- State file exclusion (.bs1-.bs9, .rtc)
- Stem-prefix filename matching
- restoreSave directory creation on fresh install
- Slot naming (always "freegosy", not timestamped)
- Autocleanup on legacy push (true, limit 5)
- Force push passes overwrite=true
- Pull cooldown (second pull within 60s is skipped)
- No pruneOldSaves in legacy push
- Exclamation mark sanitization
- Bracket and whitespace handling
- Stem-prefix matching with region/version tags
- Filters .m3u, .cue, .ccd, .mds, .toc, .sub from launchable files
- Folder-based platforms return folder path
- .exe detection in nested folders
- Skips .dll/.xnb as main ROM
- Glob pattern matching (.ini, eeprom., saves/*)
- Empty/whitespace patterns
- Case-insensitive matching
- Create
test/unit/<emulator>_strategy_test.dart - Test
getSystemNameForSlug(if applicable) - Test
supportedSlugscompleteness - Test launch args (no invalid flags)
- Test unsupported platform throws
- Add regression test in the relevant
*_regression_test.dartfile - Or create
test/unit/<issue>_<feature>_test.dartfor issue-specific tests - Lock down the exact behavior that was broken
- Use
@GenerateMocks([ServiceClass])annotation - Run
flutter pub run build_runner buildto regenerate - Generated mocks go in
<test_file>.mocks.dart - SharedPreferences mocked via
SharedPreferences.setMockInitialValues({})