feat: add package source compatibility controls
This commit is contained in:
@@ -4,7 +4,14 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
void main() {
|
||||
test('public runtime API exposes minimal integration surface', () {
|
||||
const repository = AssetGamePackageRepository();
|
||||
const options = RuntimeOptions(runtimeLuaRoot: 'custom/runtime/lua');
|
||||
const fileRepository = FileGamePackageRepository(baseDirectory: 'packages');
|
||||
const options = RuntimeOptions(
|
||||
runtimeLuaRoot: 'custom/runtime/lua',
|
||||
runtimeVersion: '1.2.0',
|
||||
hostBuild: 12,
|
||||
platform: 'windows',
|
||||
channel: 'dev',
|
||||
);
|
||||
const widget = LuaGameWidget(
|
||||
gameId: 'template',
|
||||
packageRepository: repository,
|
||||
@@ -14,6 +21,11 @@ void main() {
|
||||
expect(widget.gameId, 'template');
|
||||
expect(widget.packageRepository, same(repository));
|
||||
expect(widget.runtimeOptions.runtimeLuaRoot, 'custom/runtime/lua');
|
||||
expect(widget.runtimeOptions.runtimeVersion, '1.2.0');
|
||||
expect(widget.runtimeOptions.hostBuild, 12);
|
||||
expect(widget.runtimeOptions.platform, 'windows');
|
||||
expect(widget.runtimeOptions.channel, 'dev');
|
||||
expect(fileRepository.baseDirectory, 'packages');
|
||||
expect(LuaDardoScriptEngine.new, isA<ScriptEngine Function()>());
|
||||
expect(RuntimeLocaleResolver.localeFromTag('zh-Hans').scriptCode, 'Hans');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user