File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,4 +56,33 @@ void main() {
5656 expect (version, '9.8.7+45' );
5757 },
5858 );
59+
60+ test ('uses version in default path from package' , () async {
61+ final executablePath =
62+ '${Platform .pathSeparator }usr${Platform .pathSeparator }bin${Platform .pathSeparator }'
63+ 'pslab' ;
64+ final versionFile = File (
65+ '${Platform .pathSeparator }usr${Platform .pathSeparator }bin${Platform .pathSeparator }'
66+ 'data${Platform .pathSeparator }flutter_assets${Platform .pathSeparator }'
67+ 'version.json' ,
68+ );
69+
70+ IOOverrides .runZoned (() async {
71+ await versionFile.create (recursive: true );
72+ await versionFile.writeAsString ('{"version":"6.5.3"}' );
73+
74+ final version = await resolveAboutUsVersion (
75+ packageInfoLoader: () async => PackageInfo (
76+ appName: 'pslab' ,
77+ packageName: 'io.pslab' ,
78+ version: '' ,
79+ buildNumber: '1234' ,
80+ ),
81+ isLinux: true ,
82+ resolvedExecutable: executablePath,
83+ );
84+
85+ expect (version, '6.5.3+1234' );
86+ });
87+ });
5988}
You can’t perform that action at this time.
0 commit comments