|
|
@@ -677,6 +677,22 @@ void main() {
|
|
|
);
|
|
|
});
|
|
|
|
|
|
+ testWidgets('卷积:每组的增删按钮贴着自己那组', (tester) async {
|
|
|
+ await openTool(tester, '卷积分布列');
|
|
|
+
|
|
|
+ final buttons = find.widgetWithText(TextButton, '添加一行');
|
|
|
+ expect(buttons, findsNWidgets(2)); // X 一组、Y 一组
|
|
|
+ final xBtn = tester.getRect(buttons.first).center.dy;
|
|
|
+ final yBtn = tester.getRect(buttons.last).center.dy;
|
|
|
+ final xFirst = tester.getRect(find.text('X 取值 1')).center.dy;
|
|
|
+ final yFirst = tester.getRect(find.text('Y 取值 1')).center.dy;
|
|
|
+
|
|
|
+ // X 的按钮在 X 那组上面;Y 的按钮在 X 那组**下面**、Y 那组上面
|
|
|
+ expect(xBtn, lessThan(xFirst));
|
|
|
+ expect(yBtn, greaterThan(xFirst));
|
|
|
+ expect(yBtn, lessThan(yFirst));
|
|
|
+ });
|
|
|
+
|
|
|
testWidgets('函数图像能同时画多条曲线', (tester) async {
|
|
|
await openTool(tester, '函数图像绘制');
|
|
|
await tester.tap(find.widgetWithText(OutlinedButton, '添加函数'));
|