PasteFerry (隔空贴): clipboard and file sync across macOS, Windows and Linux. Direct-first, end-to-end encrypted. Optional official access: no server to host. Independent self-hosting remains available.
Dart airdrop-alternativeclipboardclipboard-sharingclipboard-synccopy-pastecross-platformend-to-end-encryptionfile-syncfile-transferfluttergolanglinuxmacosnat-traversalp2pself-hostedtailscaleuniversal-clipboardwebrtcwindows
test(ui): cover the update check version comparison
baiyuzeadefeeb38b4f
diff --git a/ui/test/update_check_test.dart b/ui/test/update_check_test.dartnew file mode 100644index 0000000..8835ae7--- /dev/null+++ b/ui/test/update_check_test.dart@@ -0,0 +1,26 @@+import 'package:flutter_test/flutter_test.dart';+import 'package:pasteferry_ui/mobile/update_check.dart';++void main() {+ test('版本比较按数字段进行', () {+ expect(UpdateCheck.isNewer('2.7.1', '2.7.0'), isTrue);+ expect(UpdateCheck.isNewer('2.7.0', '2.7.0'), isFalse);+ expect(UpdateCheck.isNewer('2.7.0', '2.7.1'), isFalse);+ // 两位数不能按字符串比+ expect(UpdateCheck.isNewer('2.7.10', '2.7.9'), isTrue);+ expect(UpdateCheck.isNewer('2.10.0', '2.9.9'), isTrue);+ expect(UpdateCheck.isNewer('3.0.0', '2.99.99'), isTrue);+ });++ test('缺段位按 0 算,dev 后缀不影响', () {+ expect(UpdateCheck.isNewer('2.8', '2.7.9'), isTrue);+ expect(UpdateCheck.isNewer('2.7', '2.7.0'), isFalse);+ expect(UpdateCheck.isNewer('2.7.1-dev', '2.7.0'), isTrue);+ expect(UpdateCheck.isNewer('0.1.0-dev', '2.7.0'), isFalse);+ });++ test('下载地址不带版本号,永远指向最新版', () {+ expect(UpdateCheck.apkUrl, endsWith('/releases/latest/download/PasteFerry-android-arm64.apk'));+ expect(UpdateCheck.manifestUrls.first, 'https://pasteferry.cc/updates/latest.json');+ });+}