Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dcharkes committed Jan 11, 2024
1 parent 019ea6e commit adad5ae
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 46 deletions.
83 changes: 39 additions & 44 deletions pkgs/native_assets_cli/test/api/asset_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,45 @@ import 'package:native_assets_cli/native_assets_cli.dart';
import 'package:test/test.dart';

void main() {
final fooUri = Uri.file('path/to/libfoo.so');
final foo3Uri = Uri(path: 'libfoo3.so');
final barUri = Uri(path: 'path/to/libbar.a');
final blaUri = Uri(path: 'path/with spaces/bla.dll');
final assets = [
Asset(
id: 'foo',
path: AssetAbsolutePath(fooUri),
target: Target.androidX64,
linkMode: LinkMode.dynamic,
),
Asset(
id: 'foo3',
path: AssetSystemPath(foo3Uri),
target: Target.androidX64,
linkMode: LinkMode.dynamic,
),
Asset(
id: 'foo4',
path: AssetInExecutable(),
target: Target.androidX64,
linkMode: LinkMode.dynamic,
),
Asset(
id: 'foo5',
path: AssetInProcess(),
target: Target.androidX64,
linkMode: LinkMode.dynamic,
),
Asset(
id: 'bar',
path: AssetAbsolutePath(barUri),
target: Target.linuxArm64,
linkMode: LinkMode.static,
),
Asset(
id: 'bla',
path: AssetAbsolutePath(blaUri),
target: Target.windowsX64,
linkMode: LinkMode.dynamic,
),
];

test('Asset toString', () async {
test('Asset constructors', () async {
final assets = [
Asset(
id: 'foo',
path: AssetAbsolutePath(Uri.file('path/to/libfoo.so')),
target: Target.androidX64,
linkMode: LinkMode.dynamic,
),
Asset(
id: 'foo3',
path: AssetSystemPath(Uri(path: 'libfoo3.so')),
target: Target.androidX64,
linkMode: LinkMode.dynamic,
),
Asset(
id: 'foo4',
path: AssetInExecutable(),
target: Target.androidX64,
linkMode: LinkMode.dynamic,
),
Asset(
id: 'foo5',
path: AssetInProcess(),
target: Target.androidX64,
linkMode: LinkMode.dynamic,
),
Asset(
id: 'bar',
path: AssetAbsolutePath(Uri(path: 'path/to/libbar.a')),
target: Target.linuxArm64,
linkMode: LinkMode.static,
),
Asset(
id: 'bla',
path: AssetAbsolutePath(Uri(path: 'path/with spaces/bla.dll')),
target: Target.windowsX64,
linkMode: LinkMode.dynamic,
),
];
assets.toString();
});
}
4 changes: 2 additions & 2 deletions pkgs/native_assets_cli/test/api/build_config_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ void main() async {
final configUri = tempUri.resolve('config.yaml');
final configFile = File.fromUri(configUri);
await configFile.writeAsString(configFileContents);
final buildConfig2 = await BuildConfig.fromArgs(
final buildConfigFromArgs = await BuildConfig.fromArgs(
['--config', configUri.toFilePath()],
environment: {}, // Don't inherit the test environment.
);
expect(buildConfig2, buildConfig);
expect(buildConfigFromArgs, buildConfig);
});

test('BuildConfig.version', () {
Expand Down

0 comments on commit adad5ae

Please sign in to comment.