File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import 'package:flutter_test/flutter_test.dart';
1212import 'package:http/http.dart' as http;
1313import 'package:http/testing.dart' ;
1414
15+ import 'package:pyble/app/app_info.dart' ;
1516import 'package:pyble/github_import/github_import.dart' ;
1617import 'package:pyble/pble/pble.dart' ;
1718
@@ -136,7 +137,7 @@ void _expectUnauthenticatedApiRequest(
136137 expect (request.maxRedirects, 0 );
137138 expect (request.headers['Accept' ], 'application/vnd.github+json' );
138139 expect (request.headers['X-GitHub-Api-Version' ], '2026-03-10' );
139- expect (request.headers['User-Agent' ], startsWith ( 'PyBLE/' ) );
140+ expect (request.headers['User-Agent' ], '$ kAppName /$ kAppVersion ' );
140141 final Set <String > headerNames = request.headers.keys
141142 .map ((String name) => name.toLowerCase ())
142143 .toSet ();
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: MIT
2+ // Part of PyBLE (https://pyble.dev) — see /LICENSE.
3+ //
4+ // BLD-3 [red] — one mechanically checked app identity spans package metadata,
5+ // PBLE/1 HELLO, and public GitHub requests (ADR-0044).
6+
7+ import 'dart:io' ;
8+
9+ import 'package:flutter_test/flutter_test.dart' ;
10+
11+ import 'package:pyble/app/app_info.dart' ;
12+
13+ import '../support/repo_paths.dart' ;
14+
15+ void main () {
16+ test ('app 0.2.0 beta starts at globally monotonic build 5' , () {
17+ final String pubspec = File (
18+ '${appPackageRoot ().path }/pubspec.yaml' ,
19+ ).readAsStringSync ();
20+ final List <RegExpMatch > declarations = RegExp (
21+ r'^version:\s*((?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*))\+([1-9]\d*)\s*$' ,
22+ multiLine: true ,
23+ ).allMatches (pubspec).toList (growable: false );
24+
25+ expect (
26+ declarations,
27+ hasLength (1 ),
28+ reason: 'pubspec must declare one canonical SemVer+positiveBuild value' ,
29+ );
30+ final RegExpMatch declaration = declarations.single;
31+
32+ expect (declaration.group (1 ), '0.2.0' );
33+ expect (declaration.group (2 ), '5' );
34+ expect (
35+ kAppVersion,
36+ declaration.group (1 ),
37+ reason: 'PBLE/1 HELLO must match the package base version exactly' ,
38+ );
39+ });
40+ }
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import 'package:flutter_test/flutter_test.dart';
1414import 'package:http/http.dart' as http;
1515import 'package:http/testing.dart' ;
1616
17+ import 'package:pyble/app/app_info.dart' ;
1718import 'package:pyble/github_import/github_import.dart' ;
1819
1920const String _commitSha = '1111111111111111111111111111111111111111' ;
@@ -89,7 +90,7 @@ void _expectGitHubRequest(http.Request request) {
8990 expect (request.url.hasPort, isFalse);
9091 expect (request.headers['Accept' ], 'application/vnd.github+json' );
9192 expect (request.headers['X-GitHub-Api-Version' ], '2026-03-10' );
92- expect (request.headers['User-Agent' ], startsWith ( 'PyBLE/' ) );
93+ expect (request.headers['User-Agent' ], '$ kAppName /$ kAppVersion ' );
9394 expect (request.headers.containsKey ('Authorization' ), isFalse);
9495 expect (request.headers.containsKey ('Cookie' ), isFalse);
9596}
You can’t perform that action at this time.
0 commit comments