diff --git a/.gitignore b/.gitignore index 05803ba..01b0c1a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .dart_tool/ .packages coverage +pubspec.lock # Conventional directory for build outputs build/ @@ -11,4 +12,4 @@ doc/api/ # Editor files .vscode -.DS_Store +.DS_Store \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock deleted file mode 100644 index 9261efe..0000000 --- a/pubspec.lock +++ /dev/null @@ -1,565 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a - url: "https://pub.dev" - source: hosted - version: "61.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 - url: "https://pub.dev" - source: hosted - version: "5.13.0" - args: - dependency: "direct main" - description: - name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.dev" - source: hosted - version: "2.4.2" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - barbecue: - dependency: "direct main" - description: - name: barbecue - sha256: e3a0afaf9005e466887d6c87411a2ddd8d72fc46db3caabf278ee600f1e2f92c - url: "https://pub.dev" - source: hosted - version: "0.4.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - build: - dependency: transitive - description: - name: build - sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" - url: "https://pub.dev" - source: hosted - version: "2.4.1" - built_collection: - dependency: transitive - description: - name: built_collection - sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" - url: "https://pub.dev" - source: hosted - version: "5.1.1" - built_value: - dependency: transitive - description: - name: built_value - sha256: a8de5955205b4d1dbbbc267daddf2178bd737e4bab8987c04a500478c9651e74 - url: "https://pub.dev" - source: hosted - version: "8.6.3" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff - url: "https://pub.dev" - source: hosted - version: "2.0.3" - cli_util: - dependency: transitive - description: - name: cli_util - sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 - url: "https://pub.dev" - source: hosted - version: "0.4.0" - code_builder: - dependency: transitive - description: - name: code_builder - sha256: "1be9be30396d7e4c0db42c35ea6ccd7cc6a1e19916b5dc64d6ac216b5544d677" - url: "https://pub.dev" - source: hosted - version: "4.7.0" - collection: - dependency: transitive - description: - name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://pub.dev" - source: hosted - version: "1.18.0" - colorize: - dependency: "direct main" - description: - name: colorize - sha256: "584746cd6ba1cba0633b6720f494fe6f9601c4170f0666c1579d2aa2a61071ba" - url: "https://pub.dev" - source: hosted - version: "3.0.0" - convert: - dependency: transitive - description: - name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" - source: hosted - version: "3.1.1" - coverage: - dependency: transitive - description: - name: coverage - sha256: ac86d3abab0f165e4b8f561280ff4e066bceaac83c424dd19f1ae2c2fcd12ca9 - url: "https://pub.dev" - source: hosted - version: "1.7.1" - crypto: - dependency: transitive - description: - name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" - source: hosted - version: "3.0.3" - csslib: - dependency: transitive - description: - name: csslib - sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - dart_style: - dependency: transitive - description: - name: dart_style - sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" - url: "https://pub.dev" - source: hosted - version: "2.3.2" - file: - dependency: transitive - description: - name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" - source: hosted - version: "7.0.0" - fixnum: - dependency: transitive - description: - name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" - url: "https://pub.dev" - source: hosted - version: "3.2.0" - glob: - dependency: transitive - description: - name: glob - sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" - url: "https://pub.dev" - source: hosted - version: "2.1.2" - html: - dependency: transitive - description: - name: html - sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" - url: "https://pub.dev" - source: hosted - version: "0.15.4" - http: - dependency: transitive - description: - name: http - sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" - url: "https://pub.dev" - source: hosted - version: "3.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - io: - dependency: "direct main" - description: - name: io - sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" - url: "https://pub.dev" - source: hosted - version: "1.0.4" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" - json_annotation: - dependency: transitive - description: - name: json_annotation - sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 - url: "https://pub.dev" - source: hosted - version: "4.8.1" - lints: - dependency: "direct dev" - description: - name: lints - sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c - url: "https://pub.dev" - source: hosted - version: "1.0.1" - logging: - dependency: transitive - description: - name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - markdown: - dependency: transitive - description: - name: markdown - sha256: acf35edccc0463a9d7384e437c015a3535772e09714cf60e07eeef3a15870dcd - url: "https://pub.dev" - source: hosted - version: "7.1.1" - matcher: - dependency: transitive - description: - name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" - url: "https://pub.dev" - source: hosted - version: "0.12.16" - meta: - dependency: transitive - description: - name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 - url: "https://pub.dev" - source: hosted - version: "1.11.0" - mime: - dependency: transitive - description: - name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" - source: hosted - version: "1.0.4" - mockito: - dependency: "direct dev" - description: - name: mockito - sha256: "7d5b53bcd556c1bc7ffbe4e4d5a19c3e112b7e925e9e172dd7c6ad0630812616" - url: "https://pub.dev" - source: hosted - version: "5.4.2" - node_preamble: - dependency: transitive - description: - name: node_preamble - sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - package_config: - dependency: "direct main" - description: - name: package_config - sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - pana: - dependency: "direct main" - description: - name: pana - sha256: a9c03df79c6dde15848efbfb49b07065c30cc13e828e517c2a36eb83d4cffc41 - url: "https://pub.dev" - source: hosted - version: "0.21.33" - path: - dependency: "direct main" - description: - name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - pool: - dependency: transitive - description: - name: pool - sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" - url: "https://pub.dev" - source: hosted - version: "1.5.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 - url: "https://pub.dev" - source: hosted - version: "1.2.3" - retry: - dependency: transitive - description: - name: retry - sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" - url: "https://pub.dev" - source: hosted - version: "3.1.2" - safe_url_check: - dependency: transitive - description: - name: safe_url_check - sha256: b85685b48d74dcd9659e1f2228f900b9fb37cd3b4ba085ca4f593d06c00c36a6 - url: "https://pub.dev" - source: hosted - version: "1.1.1" - shelf: - dependency: transitive - description: - name: shelf - sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 - url: "https://pub.dev" - source: hosted - version: "1.4.1" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - shelf_static: - dependency: transitive - description: - name: shelf_static - sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e - url: "https://pub.dev" - source: hosted - version: "1.1.2" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" - url: "https://pub.dev" - source: hosted - version: "1.0.4" - source_gen: - dependency: transitive - description: - name: source_gen - sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 - url: "https://pub.dev" - source: hosted - version: "1.4.0" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - source_maps: - dependency: transitive - description: - name: source_maps - sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" - url: "https://pub.dev" - source: hosted - version: "0.10.12" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://pub.dev" - source: hosted - version: "1.11.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - string_validator: - dependency: transitive - description: - name: string_validator - sha256: "50dd8ecf91db6a732f4a851eeae81ee12406eedc62d0da72f2d91a04a2d10dd8" - url: "https://pub.dev" - source: hosted - version: "0.3.0" - tar: - dependency: transitive - description: - name: tar - sha256: "85ffd53e277f2bac8afa2885e6b195e26937e9c402424c3d88d92fd920b56de9" - url: "https://pub.dev" - source: hosted - version: "0.5.6" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test: - dependency: "direct dev" - description: - name: test - sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f - url: "https://pub.dev" - source: hosted - version: "1.24.9" - test_api: - dependency: transitive - description: - name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" - url: "https://pub.dev" - source: hosted - version: "0.6.1" - test_core: - dependency: transitive - description: - name: test_core - sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a - url: "https://pub.dev" - source: hosted - version: "0.5.9" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 - url: "https://pub.dev" - source: hosted - version: "13.0.0" - watcher: - dependency: transitive - description: - name: watcher - sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b - url: "https://pub.dev" - source: hosted - version: "2.4.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" - url: "https://pub.dev" - source: hosted - version: "1.2.1" - yaml: - dependency: "direct main" - description: - name: yaml - sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" - url: "https://pub.dev" - source: hosted - version: "3.1.2" -sdks: - dart: ">=3.0.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1abc617..60c35c8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,14 +12,14 @@ dependencies: colorize: ^3.0.0 io: ^1.0.3 package_config: ^2.0.2 - pana: ^0.21.9 + pana: ^0.23.0 path: ^1.7.0 yaml: ^3.1.0 dev_dependencies: - lints: ^1.0.0 + lints: ^6.0.0 mockito: ^5.1.0 - test: ^1.20.2 + test: ^1.28.0 executables: lic_ck: license_checker diff --git a/test/lib/src/dependency_checker_test.dart b/test/lib/src/dependency_checker_test.dart index 1516404..85771fa 100644 --- a/test/lib/src/dependency_checker_test.dart +++ b/test/lib/src/dependency_checker_test.dart @@ -7,14 +7,14 @@ import 'package:test/test.dart'; import 'package:license_checker/src/config.dart'; import 'package:license_checker/src/dependency_checker.dart'; -typedef _PropertyGetter = FutureOr Function( +typedef PropertyGetter = FutureOr Function( DependencyChecker dependencyChecker, ); -typedef _ReturnMatcher = M Function(); +typedef ReturnMatcher = M Function(); class DependencyTest { - final _PropertyGetter testProperty; - final _ReturnMatcher expectedReturnMatcher; + final PropertyGetter testProperty; + final ReturnMatcher expectedReturnMatcher; final String testDescription; DependencyTest({ @@ -34,13 +34,13 @@ void main() { 'dodgers', Uri( scheme: 'file', - path: Directory.current.absolute.path + - '/test/lib/src/fixtures/dodgers/', + path: + '${Directory.current.absolute.path}/test/lib/src/fixtures/dodgers/', ), ), ); - List> _validTests = [ + List> validTests = [ DependencyTest( testProperty: (d) => d.name, expectedReturnMatcher: () => 'dodgers', @@ -49,8 +49,7 @@ void main() { DependencyTest( testProperty: (d) => dc.licenseFile?.path, expectedReturnMatcher: () => - Directory.current.absolute.path + - '/test/lib/src/fixtures/dodgers/LICENSE', + '${Directory.current.absolute.path}/test/lib/src/fixtures/dodgers/LICENSE', testDescription: 'should get a license file', ), DependencyTest( @@ -83,7 +82,7 @@ void main() { ), ]; - for (DependencyTest t in _validTests) { + for (DependencyTest t in validTests) { test(t.testDescription, () async { expect(await t.testProperty(dc), t.expectedReturnMatcher()); }); @@ -99,13 +98,13 @@ void main() { 'dodgers', Uri( scheme: 'file', - path: Directory.current.absolute.path + - '/test/lib/src/fixtures/dodgers/', + path: + '${Directory.current.absolute.path}/test/lib/src/fixtures/dodgers/', ), ), ); - List> _validTests = [ + List> validTests = [ DependencyTest( testProperty: (d) async { return d.licenseName; @@ -122,7 +121,7 @@ void main() { ), ]; - for (DependencyTest t in _validTests) { + for (DependencyTest t in validTests) { test(t.testDescription, () async { expect(await t.testProperty(dc), t.expectedReturnMatcher()); }); @@ -138,13 +137,13 @@ void main() { 'angeles', Uri( scheme: 'file', - path: Directory.current.absolute.path + - '/test/lib/src/fixtures/angeles/', + path: + '${Directory.current.absolute.path}/test/lib/src/fixtures/angeles/', ), ), ); - List> _validTests = [ + List> validTests = [ DependencyTest( testProperty: (d) => d.name, expectedReturnMatcher: () => 'angeles', @@ -185,7 +184,7 @@ void main() { ), ]; - for (DependencyTest t in _validTests) { + for (DependencyTest t in validTests) { test(t.testDescription, () async { expect(await t.testProperty(dc), t.expectedReturnMatcher()); }); @@ -202,7 +201,7 @@ void main() { Uri( scheme: 'file', path: - Directory.current.absolute.path + '/test/lib/src/fixtures/mets/', + '${Directory.current.absolute.path}/test/lib/src/fixtures/mets/', ), ), ); @@ -217,12 +216,12 @@ void main() { Uri( scheme: 'file', path: - Directory.current.absolute.path + '/test/lib/src/fixtures/mets/', + '${Directory.current.absolute.path}/test/lib/src/fixtures/mets/', ), ), ); - List> _validTests = [ + List> validTests = [ DependencyTest( testProperty: (d) => d.name, expectedReturnMatcher: () => 'mets', @@ -231,8 +230,7 @@ void main() { DependencyTest( testProperty: (d) => d.licenseFile?.path, expectedReturnMatcher: () => - Directory.current.absolute.path + - '/test/lib/src/fixtures/mets/LICENSE', + '${Directory.current.absolute.path}/test/lib/src/fixtures/mets/LICENSE', testDescription: 'should return the license file', ), DependencyTest( @@ -260,7 +258,7 @@ void main() { ), ]; - for (DependencyTest t in _validTests) { + for (DependencyTest t in validTests) { test(t.testDescription, () async { expect(await t.testProperty(dc), t.expectedReturnMatcher()); }); @@ -276,7 +274,7 @@ void main() { 'mlb', Uri( scheme: 'file', - path: Directory.current.absolute.path + '/test/lib/src/fixtures/mlb/', + path: '${Directory.current.absolute.path}/test/lib/src/fixtures/mlb/', ), ), ); @@ -290,12 +288,12 @@ void main() { 'mlb', Uri( scheme: 'file', - path: Directory.current.absolute.path + '/test/lib/src/fixtures/mlb/', + path: '${Directory.current.absolute.path}/test/lib/src/fixtures/mlb/', ), ), ); - List> _validTests = [ + List> validTests = [ DependencyTest( testProperty: (d) => d.name, expectedReturnMatcher: () => 'mlb', @@ -304,8 +302,7 @@ void main() { DependencyTest( testProperty: (d) => dc.licenseFile?.path, expectedReturnMatcher: () => - Directory.current.absolute.path + - '/test/lib/src/fixtures/mlb/LICENSE', + '${Directory.current.absolute.path}/test/lib/src/fixtures/mlb/LICENSE', testDescription: 'should return the license file', ), DependencyTest( @@ -348,7 +345,7 @@ void main() { ), ]; - for (DependencyTest t in _validTests) { + for (DependencyTest t in validTests) { test(t.testDescription, () async { expect(await t.testProperty(dc), t.expectedReturnMatcher()); }); @@ -364,13 +361,13 @@ void main() { 'padres', Uri( scheme: 'file', - path: Directory.current.absolute.path + - '/test/lib/src/fixtures/padres/', + path: + '${Directory.current.absolute.path}/test/lib/src/fixtures/padres/', ), ), ); - List> _validTests = [ + List> validTests = [ DependencyTest( testProperty: (d) => d.name, expectedReturnMatcher: () => 'padres', @@ -379,8 +376,7 @@ void main() { DependencyTest( testProperty: (d) => dc.licenseFile?.path, expectedReturnMatcher: () => - Directory.current.absolute.path + - '/test/lib/src/fixtures/padres/LICENSE', + '${Directory.current.absolute.path}/test/lib/src/fixtures/padres/LICENSE', testDescription: 'should return the license file', ), DependencyTest( @@ -418,7 +414,7 @@ void main() { ), ]; - for (DependencyTest t in _validTests) { + for (DependencyTest t in validTests) { test(t.testDescription, () async { expect(await t.testProperty(dc), t.expectedReturnMatcher()); }); diff --git a/test/lib/src/format_test.dart b/test/lib/src/format_test.dart index cdaea1d..f6101c3 100644 --- a/test/lib/src/format_test.dart +++ b/test/lib/src/format_test.dart @@ -174,8 +174,7 @@ void main() { copyright: '2022 Los Angeles', sourceLocation: 'https://chavez.ravine', licenseFile: File( - Directory.current.absolute.path + - '/test/lib/src/fixtures/dodgers/LICENSE', + '${Directory.current.absolute.path}/test/lib/src/fixtures/dodgers/LICENSE', ), ); String s = strBuff.toString(); diff --git a/test/lib/src/package_checker_test.dart b/test/lib/src/package_checker_test.dart index 232cba6..94cb178 100644 --- a/test/lib/src/package_checker_test.dart +++ b/test/lib/src/package_checker_test.dart @@ -7,31 +7,31 @@ import 'package:license_checker/src/config.dart'; import 'package:license_checker/src/package_checker.dart'; void main() { - Config _config = + Config config = Config.fromFile(File('test/lib/src/fixtures/valid_config.yaml')); test('should properly create a PackageChecker with all proper attributes', () async { - Pubspec _pubspec = Pubspec.parseYaml( + Pubspec pubspec = Pubspec.parseYaml( await File('test/lib/src/fixtures/dodgers/pubspec.yaml').readAsString(), ); PackageChecker pc = await PackageChecker.fromDirectory( directory: Directory('test/lib/src/fixtures/dodgers'), - config: _config, + config: config, ); expect( pc.packages.map((p) => p.name), containsAll(['padres', 'as', 'angeles', 'mlb']), ); - expect(pc.config, _config); - expect(pc.pubspec.name, _pubspec.name); + expect(pc.config, config); + expect(pc.pubspec.name, pubspec.name); }); test('should load package checker from the current directory', () async { PackageChecker pc = - await PackageChecker.fromCurrentDirectory(config: _config); + await PackageChecker.fromCurrentDirectory(config: config); expect(pc.pubspec.name, 'license_checker'); - expect(pc.config, _config); + expect(pc.config, config); }); test('should throw an exception when no pubspec.yaml is found', () { @@ -39,7 +39,7 @@ void main() { () async { await PackageChecker.fromDirectory( directory: Directory('test/lib/src/fixtures/padres'), - config: _config, + config: config, ); }, throwsA( @@ -58,7 +58,7 @@ void main() { () async { await PackageChecker.fromDirectory( directory: Directory('test/lib/src/fixtures/angeles'), - config: _config, + config: config, ); }, throwsA(