v1.3.10: 应用身份切换 cc.sincos.edc(彻底解决桌面名称); 移除尺寸标注与图元库自定义; 修复帮助中心空白与 Windows 更新包校验
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// 图元库手绘识别测试:内置符号笔迹命中、乱涂拒绝、自定义图元可识别。
|
||||
import 'dart:io';
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
@@ -108,41 +107,6 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('自定义图元:保存到用户目录后能被识别', () async {
|
||||
final Directory tmp = await Directory.systemTemp.createTemp('edc-symr-');
|
||||
addTearDown(() async => tmp.delete(recursive: true));
|
||||
// 自定义三角形图元。
|
||||
await SymbolLibrary.saveUser(
|
||||
const LibSymbol(
|
||||
id: 'my-tri',
|
||||
name: '自定义三角',
|
||||
category: '自定义',
|
||||
prims: <SymPrim>[
|
||||
SymPrim(
|
||||
kind: SymPrimKind.polyline,
|
||||
pts: <double>[50, 10, 90, 80, 10, 80, 50, 10],
|
||||
),
|
||||
],
|
||||
pins: <SymPin>[],
|
||||
),
|
||||
dir: tmp,
|
||||
);
|
||||
final List<LibSymbol> catalog = await SymbolLibrary.all(dir: tmp);
|
||||
final ArchSymbolMatch? m = recognizeArchSymbol(
|
||||
<List<Offset>>[
|
||||
<Offset>[
|
||||
const Offset(50, 10),
|
||||
const Offset(90, 80),
|
||||
const Offset(10, 80),
|
||||
const Offset(50, 10),
|
||||
],
|
||||
],
|
||||
catalog,
|
||||
);
|
||||
expect(m, isNotNull, reason: '自定义图元应能被识别(图元库可扩展)');
|
||||
expect(m!.symbol.id, 'my-tri');
|
||||
});
|
||||
|
||||
test('空 / 过短笔迹:null', () {
|
||||
expect(recognizeArchSymbol(const <List<Offset>>[], SymbolLibrary.builtin), isNull);
|
||||
expect(
|
||||
|
||||
Reference in New Issue
Block a user