diff --git a/.github/workflows/test-package.yml b/.github/workflows/test-package.yml index 2e47591..1768fc8 100644 --- a/.github/workflows/test-package.yml +++ b/.github/workflows/test-package.yml @@ -45,8 +45,7 @@ jobs: strategy: fail-fast: false matrix: - # Add macos-latest and/or windows-latest if relevant for this package. - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest] sdk: [3.2, dev] steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 @@ -57,5 +56,5 @@ jobs: name: Install dependencies run: dart pub get - name: Run tests - run: dart run build_runner test -- -p chrome,vm + run: dart test -p chrome,vm if: always() && steps.install.outcome == 'success' diff --git a/pubspec.yaml b/pubspec.yaml index b713079..6ac7f54 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,8 +10,5 @@ dependencies: path: ^1.8.0 dev_dependencies: - build_runner: ^2.0.0 - build_test: ^2.1.2 - build_web_compilers: ^4.0.0 dart_flutter_team_lints: ^2.0.0 test: ^1.16.0 diff --git a/test/discovery_test.dart b/test/discovery_test.dart index ee77559..2ca337a 100644 --- a/test/discovery_test.dart +++ b/test/discovery_test.dart @@ -59,7 +59,7 @@ void main() { fileTest('package_config.json', { '.packages': 'invalid .packages file', 'script.dart': 'main(){}', - 'packages': {'shouldNotBeFound': {}}, + 'packages': {'shouldNotBeFound': {}}, '.dart_tool': { 'package_config.json': packageConfigFile, } diff --git a/test/parse_test.dart b/test/parse_test.dart index 402fe8c..a92b9bf 100644 --- a/test/parse_test.dart +++ b/test/parse_test.dart @@ -301,6 +301,25 @@ void main() { Uri.parse('package:qux/diz')); }); + test('packageOf is case sensitive on windows', () { + var configBytes = utf8.encode(json.encode({ + 'configVersion': 2, + 'packages': [ + {'name': 'foo', 'rootUri': 'file:///C:/Foo/', 'packageUri': 'lib/'}, + ] + })); + var config = parsePackageConfigBytes( + // ignore: unnecessary_cast + configBytes as Uint8List, + Uri.parse('file:///C:/tmp/.dart_tool/file.dart'), + throwError); + expect(config.version, 2); + expect( + config.packageOf(Uri.parse('file:///C:/foo/lala/lala.dart')), null); + expect(config.packageOf(Uri.parse('file:///C:/Foo/lala/lala.dart'))!.name, + 'foo'); + }); + group('invalid', () { void testThrows(String name, String source) { test(name, () {