fix: parse linux distro metadata

This commit is contained in:
Edison Jwa
2026-05-25 16:02:01 +09:00
parent 4a2a05ef83
commit 862f83b297
2 changed files with 41 additions and 9 deletions
@@ -38,6 +38,25 @@ void main() {
expect(sdl.installHints.single.command, 'sudo apt install libsdl2-2.0-0');
});
test('distro detection parses quoted ID_LIKE lists', () async {
debugResetStartupDependencyCheck(
platformIsLinux: () => true,
libraryProbe: (candidate) => false,
fileExists: (_) async => true,
osReleaseProvider: () async => 'ID=rocky\nID_LIKE="fedora rhel"\n',
resolvedExecutableProvider: () => '/opt/chanora/chanora_flutter',
currentDirectoryProvider: () => '/tmp',
);
final result = await checkStartupDependencies();
expect(result.platformLabel, 'Fedora');
final sdl = result.issues.singleWhere(
(issue) => issue.id == 'linux-sdl2-runtime',
);
expect(sdl.installHints.single.command, 'sudo dnf install SDL2');
});
test(
'missing ONNX runtime is reported as recommended when SDL2 is present',
() async {