mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-07-15 03:04:25 +08:00
Add:创建 flutter go web 版
This commit is contained in:
27
packages/flutter_web_ui/test/paragraph_builder_test.dart
Normal file
27
packages/flutter_web_ui/test/paragraph_builder_test.dart
Normal file
@ -0,0 +1,27 @@
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter_web_ui/ui.dart';
|
||||
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
test('Should be able to build and layout a paragraph', () {
|
||||
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle());
|
||||
builder.addText('Hello');
|
||||
final Paragraph paragraph = builder.build();
|
||||
expect(paragraph, isNotNull);
|
||||
|
||||
paragraph.layout(const ParagraphConstraints(width: 800.0));
|
||||
expect(paragraph.width, isNonZero);
|
||||
expect(paragraph.height, isNonZero);
|
||||
});
|
||||
|
||||
test('PushStyle should not segfault after build()', () {
|
||||
final ParagraphBuilder paragraphBuilder =
|
||||
ParagraphBuilder(ParagraphStyle());
|
||||
paragraphBuilder.build();
|
||||
paragraphBuilder.pushStyle(TextStyle());
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user