@@ -42,37 +42,6 @@ void main() {
4242 });
4343 });
4444
45- group ('TextStyle' , () {
46- final TextStyle ts0 = TextStyle (fontWeight: FontWeight .w700, fontSize: 12.0 , height: 123.0 );
47- final TextStyle ts1 = TextStyle (color: const Color (0xFF00FF00 ), fontWeight: FontWeight .w800, fontSize: 10.0 , height: 100.0 );
48- final TextStyle ts2 = TextStyle (fontFamily: 'test' );
49- final TextStyle ts3 = TextStyle (fontFamily: 'foo' , fontFamilyFallback: < String > ['Roboto' , 'test' ]);
50- final TextStyle ts4 = TextStyle (leadingDistribution: TextLeadingDistribution .even);
51-
52- test ('toString works' , () {
53- expect (
54- ts0.toString (),
55- equals ('TextStyle(color: unspecified, decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, decorationThickness: unspecified, fontWeight: FontWeight.w700, fontStyle: unspecified, textBaseline: unspecified, fontFamily: unspecified, fontFamilyFallback: unspecified, fontSize: 12.0, letterSpacing: unspecified, wordSpacing: unspecified, height: 123.0x, leadingDistribution: unspecified, locale: unspecified, background: unspecified, foreground: unspecified, shadows: unspecified, fontFeatures: unspecified)' ),
56- );
57- expect (
58- ts1.toString (),
59- equals ('TextStyle(color: Color(0xff00ff00), decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, decorationThickness: unspecified, fontWeight: FontWeight.w800, fontStyle: unspecified, textBaseline: unspecified, fontFamily: unspecified, fontFamilyFallback: unspecified, fontSize: 10.0, letterSpacing: unspecified, wordSpacing: unspecified, height: 100.0x, leadingDistribution: unspecified, locale: unspecified, background: unspecified, foreground: unspecified, shadows: unspecified, fontFeatures: unspecified)' ),
60- );
61- expect (
62- ts2.toString (),
63- equals ('TextStyle(color: unspecified, decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, decorationThickness: unspecified, fontWeight: unspecified, fontStyle: unspecified, textBaseline: unspecified, fontFamily: test, fontFamilyFallback: unspecified, fontSize: unspecified, letterSpacing: unspecified, wordSpacing: unspecified, height: unspecified, leadingDistribution: unspecified, locale: unspecified, background: unspecified, foreground: unspecified, shadows: unspecified, fontFeatures: unspecified)' ),
64- );
65- expect (
66- ts3.toString (),
67- equals ('TextStyle(color: unspecified, decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, decorationThickness: unspecified, fontWeight: unspecified, fontStyle: unspecified, textBaseline: unspecified, fontFamily: foo, fontFamilyFallback: [Roboto, test], fontSize: unspecified, letterSpacing: unspecified, wordSpacing: unspecified, height: unspecified, leadingDistribution: unspecified, locale: unspecified, background: unspecified, foreground: unspecified, shadows: unspecified, fontFeatures: unspecified)' ),
68- );
69- expect (
70- ts4.toString (),
71- equals ('TextStyle(color: unspecified, decoration: unspecified, decorationColor: unspecified, decorationStyle: unspecified, decorationThickness: unspecified, fontWeight: unspecified, fontStyle: unspecified, textBaseline: unspecified, fontFamily: unspecified, fontFamilyFallback: unspecified, fontSize: unspecified, letterSpacing: unspecified, wordSpacing: unspecified, height: unspecified, leadingDistribution: TextLeadingDistribution.even, locale: unspecified, background: unspecified, foreground: unspecified, shadows: unspecified, fontFeatures: unspecified)' ),
72- );
73- });
74- });
75-
7645 group ('TextHeightBehavior' , () {
7746 const TextHeightBehavior behavior0 = TextHeightBehavior ();
7847 const TextHeightBehavior behavior1 = TextHeightBehavior (
@@ -85,10 +54,6 @@ void main() {
8554 const TextHeightBehavior behavior3 = TextHeightBehavior (
8655 applyHeightToLastDescent: false
8756 );
88- const TextHeightBehavior behavior4 = TextHeightBehavior (
89- applyHeightToLastDescent: false ,
90- leadingDistribution: TextLeadingDistribution .even,
91- );
9257
9358 test ('default constructor works' , () {
9459 expect (behavior0.applyHeightToFirstAscent, equals (true ));
@@ -102,33 +67,27 @@ void main() {
10267
10368 expect (behavior3.applyHeightToFirstAscent, equals (true ));
10469 expect (behavior3.applyHeightToLastDescent, equals (false ));
105-
106- expect (behavior4.applyHeightToLastDescent, equals (false ));
107- expect (behavior4.leadingDistribution, equals (TextLeadingDistribution .even));
10870 });
10971
11072 test ('encode works' , () {
11173 expect (behavior0.encode (), equals (0 ));
11274 expect (behavior1.encode (), equals (3 ));
11375 expect (behavior2.encode (), equals (1 ));
11476 expect (behavior3.encode (), equals (2 ));
115- expect (behavior4.encode (), equals (6 ));
11677 });
11778
11879 test ('decode works' , () {
119- expect (TextHeightBehavior .fromEncoded (0 ), equals (behavior0));
120- expect (TextHeightBehavior .fromEncoded (3 ), equals (behavior1));
121- expect (TextHeightBehavior .fromEncoded (1 ), equals (behavior2));
122- expect (TextHeightBehavior .fromEncoded (2 ), equals (behavior3));
123- expect (TextHeightBehavior .fromEncoded (6 ), equals (behavior4));
80+ expect (const TextHeightBehavior .fromEncoded (0 ), equals (behavior0));
81+ expect (const TextHeightBehavior .fromEncoded (3 ), equals (behavior1));
82+ expect (const TextHeightBehavior .fromEncoded (1 ), equals (behavior2));
83+ expect (const TextHeightBehavior .fromEncoded (2 ), equals (behavior3));
12484 });
12585
12686 test ('toString works' , () {
127- expect (behavior0.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: true, applyHeightToLastDescent: true, leadingDistribution: TextLeadingDistribution.proportional)' ));
128- expect (behavior1.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: false, applyHeightToLastDescent: false, leadingDistribution: TextLeadingDistribution.proportional)' ));
129- expect (behavior2.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: false, applyHeightToLastDescent: true, leadingDistribution: TextLeadingDistribution.proportional)' ));
130- expect (behavior3.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: true, applyHeightToLastDescent: false, leadingDistribution: TextLeadingDistribution.proportional)' ));
131- expect (behavior4.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: true, applyHeightToLastDescent: false, leadingDistribution: TextLeadingDistribution.even)' ));
87+ expect (behavior0.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: true, applyHeightToLastDescent: true)' ));
88+ expect (behavior1.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: false, applyHeightToLastDescent: false)' ));
89+ expect (behavior2.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: false, applyHeightToLastDescent: true)' ));
90+ expect (behavior3.toString (), equals ('TextHeightBehavior(applyHeightToFirstAscent: true, applyHeightToLastDescent: false)' ));
13291 });
13392 });
13493
0 commit comments