aves_mio/.flutter/packages/flutter/test/painting/strut_style_test.dart
Fabio Micheluz 2c988f959b
Some checks are pending
Quality check / Flutter analysis (push) Waiting to run
Quality check / CodeQL analysis (java-kotlin) (push) Waiting to run
first commit
2026-02-19 13:25:23 +01:00

39 lines
1.6 KiB
Dart

// Copyright 2014 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/painting.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
test('StrutStyle diagnostics test', () {
const s0 = StrutStyle(fontFamily: 'Serif', fontSize: 14);
expect(s0.toString(), equals('StrutStyle(family: Serif, size: 14.0)'));
const s1 = StrutStyle(fontFamily: 'Serif', fontSize: 14, forceStrutHeight: true);
expect(s1.fontFamily, 'Serif');
expect(s1.fontSize, 14.0);
expect(s1, equals(s1));
expect(s1.toString(), equals('StrutStyle(family: Serif, size: 14.0, <strut height forced>)'));
const s2 = StrutStyle(fontFamily: 'Serif', fontSize: 14, forceStrutHeight: false);
expect(s2.toString(), equals('StrutStyle(family: Serif, size: 14.0, <strut height normal>)'));
const s3 = StrutStyle();
expect(s3.toString(), equals('StrutStyle'));
const s4 = StrutStyle(forceStrutHeight: false);
expect(s4.toString(), equals('StrutStyle(<strut height normal>)'));
const s5 = StrutStyle(forceStrutHeight: true);
expect(s5.toString(), equals('StrutStyle(<strut height forced>)'));
const s6 = StrutStyle(height: 14, leadingDistribution: TextLeadingDistribution.even);
expect(s6.toString(), equals('StrutStyle(height: 14.0x, leadingDistribution: even)'));
const s7 = StrutStyle(height: 14, leadingDistribution: TextLeadingDistribution.proportional);
expect(s7.toString(), equals('StrutStyle(height: 14.0x, leadingDistribution: proportional)'));
expect(s6, isNot(equals(s7)));
});
}