paragraph_builder_test.dart 641 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1 2 3 4
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import 'dart:ui';
6 7 8 9 10

import 'package:test/test.dart';

void main() {
  test("Should be able to build and layout a paragraph", () {
11
    final ParagraphBuilder builder = new ParagraphBuilder(new ParagraphStyle());
12
    builder.addText('Hello');
13
    final Paragraph paragraph = builder.build();
14
    expect(paragraph, isNotNull);
15

Adam Barth's avatar
Adam Barth committed
16
    paragraph.layout(new ParagraphConstraints(width: 800.0));
17 18
    expect(paragraph.width, isNonZero);
    expect(paragraph.height, isNonZero);
19 20
  });
}