未验证 提交 70802823 编写于 作者: O openharmony_ci 提交者: Gitee

!8834 修改小数取整

Merge pull request !8834 from zhangshuqi/master
...@@ -65,9 +65,9 @@ export default function ColumnSetLayoutWeight_SubChange() { ...@@ -65,9 +65,9 @@ export default function ColumnSetLayoutWeight_SubChange() {
expect(Math.round(setLayoutWeight3.top - setLayoutWeight2.bottom)).assertEqual(vp2px(30)) expect(Math.round(setLayoutWeight3.top - setLayoutWeight2.bottom)).assertEqual(vp2px(30))
expect(setLayoutWeight.bottom).assertEqual(setLayoutWeight3.bottom) expect(setLayoutWeight.bottom).assertEqual(setLayoutWeight3.bottom)
expect(Math.round(setLayoutWeight1.bottom - setLayoutWeight1.top)).assertEqual(vp2px(510/3)) expect(Math.round(setLayoutWeight1.bottom - setLayoutWeight1.top)).assertEqual(Math.round(vp2px(510/3)))
expect(Math.round(setLayoutWeight2.bottom - setLayoutWeight2.top)).assertEqual(vp2px(340/3)) expect(Math.round(setLayoutWeight2.bottom - setLayoutWeight2.top)).assertEqual(Math.round(vp2px(340/3)))
expect(Math.round(setLayoutWeight3.bottom - setLayoutWeight3.top)).assertEqual(vp2px(170/3)) expect(Math.round(setLayoutWeight3.bottom - setLayoutWeight3.top)).assertEqual(Math.round(vp2px(170/3)))
console.info('new testColumnSetLayoutWeightWithRateThreeTwoOne END'); console.info('new testColumnSetLayoutWeightWithRateThreeTwoOne END');
done(); done();
}); });
......
...@@ -101,17 +101,17 @@ export default function AlignContentFlexP_Fixed_Margin() { ...@@ -101,17 +101,17 @@ export default function AlignContentFlexP_Fixed_Margin() {
expect(obj.$attrs.constructor.direction).assertEqual("FlexDirection.Row"); expect(obj.$attrs.constructor.direction).assertEqual("FlexDirection.Row");
expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly"); expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly");
expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom))
.assertEqual(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top); .assertEqual(Math.round(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top));
expect(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom))
.assertEqual(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top); .assertEqual(Math.round(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top));
expect(Math.round(AlignContentFlexSpaceEvenly_1.left - AlignContentFlexSpaceEvenly_flex001.left)) expect(Math.round(AlignContentFlexSpaceEvenly_1.left - AlignContentFlexSpaceEvenly_flex001.left))
.assertEqual(vp2px(10)); .assertEqual(vp2px(10));
expect(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top)) expect(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top))
.assertEqual(vp2px(50/3)+vp2px(10)); .assertEqual(Math.round(vp2px(50/3)+vp2px(10)));
console.info('testAlignContentSpaceEvenlyFlexFixedMarginSatisfy END'); console.info('testAlignContentSpaceEvenlyFlexFixedMarginSatisfy END');
done(); done();
......
...@@ -102,8 +102,8 @@ export default function AlignContentFlexP_Fixed_Offset() { ...@@ -102,8 +102,8 @@ export default function AlignContentFlexP_Fixed_Offset() {
expect(Math.round(AlignContentFlexSpaceEvenly_2.left - AlignContentFlexSpaceEvenly_flex001.left)) expect(Math.round(AlignContentFlexSpaceEvenly_2.left - AlignContentFlexSpaceEvenly_flex001.left))
.assertEqual(vp2px(150)); .assertEqual(vp2px(150));
expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom))
.assertEqual(vp2px(50/3)); .assertEqual(Math.round(vp2px(50/3)));
expect(Math.round((AlignContentFlexSpaceEvenly_1.right - AlignContentFlexSpaceEvenly_2.left)*10)/10) expect(Math.round((AlignContentFlexSpaceEvenly_1.right - AlignContentFlexSpaceEvenly_2.left)*10)/10)
.assertEqual(vp2px(15)); .assertEqual(vp2px(15));
...@@ -111,11 +111,11 @@ export default function AlignContentFlexP_Fixed_Offset() { ...@@ -111,11 +111,11 @@ export default function AlignContentFlexP_Fixed_Offset() {
expect(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_2.top)) expect(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_2.top))
.assertEqual(vp2px(30)); .assertEqual(vp2px(30));
expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom))
.assertEqual(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top); .assertEqual(Math.round(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top));
expect(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom))
.assertEqual(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top); .assertEqual(Math.round(AlignContentFlexSpaceEvenly_2.top - AlignContentFlexSpaceEvenly_flex001.top));
console.info('testAlignContentSpaceEvenlyFlexPfixedOffset END'); console.info('testAlignContentSpaceEvenlyFlexPfixedOffset END');
done(); done();
......
...@@ -97,11 +97,11 @@ export default function AlignContentFlexP_Fixed_Visibility() { ...@@ -97,11 +97,11 @@ export default function AlignContentFlexP_Fixed_Visibility() {
expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly"); expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly");
expect(textObj.$attrs.visibility).assertEqual("Visibility.Hidden"); expect(textObj.$attrs.visibility).assertEqual("Visibility.Hidden");
expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom))
.assertEqual(AlignContentFlexSpaceEvenly_3.top - AlignContentFlexSpaceEvenly_flex001.top); .assertEqual(Math.round(AlignContentFlexSpaceEvenly_3.top - AlignContentFlexSpaceEvenly_flex001.top));
expect(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom))
.assertEqual(AlignContentFlexSpaceEvenly_3.top - AlignContentFlexSpaceEvenly_flex001.top); .assertEqual(Math.round(AlignContentFlexSpaceEvenly_3.top - AlignContentFlexSpaceEvenly_flex001.top));
expect(Math.round(AlignContentFlexSpaceEvenly_2.left - AlignContentFlexSpaceEvenly_flex001.left)) expect(Math.round(AlignContentFlexSpaceEvenly_2.left - AlignContentFlexSpaceEvenly_flex001.left))
.assertEqual(vp2px(150)); .assertEqual(vp2px(150));
......
...@@ -102,11 +102,11 @@ export default function AlignContentFlexP_fixed() { ...@@ -102,11 +102,11 @@ export default function AlignContentFlexP_fixed() {
expect(obj.$attrs.constructor.direction).assertEqual("FlexDirection.Row"); expect(obj.$attrs.constructor.direction).assertEqual("FlexDirection.Row");
expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly"); expect(obj.$attrs.constructor.alignContent).assertEqual("FlexAlign.SpaceEvenly");
expect(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_flex001.bottom - AlignContentFlexSpaceEvenly_4.bottom))
.assertEqual(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top); .assertEqual(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top));
expect(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom) expect(Math.round(AlignContentFlexSpaceEvenly_4.top - AlignContentFlexSpaceEvenly_3.bottom))
.assertEqual(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top); .assertEqual(Math.round(AlignContentFlexSpaceEvenly_1.top - AlignContentFlexSpaceEvenly_flex001.top));
console.info('testAlignContentSpaceEvenlyFlexFixedSatisfy END'); console.info('testAlignContentSpaceEvenlyFlexFixedSatisfy END');
done(); done();
......
...@@ -64,9 +64,9 @@ export default function flexTextMargin_CenterJsunit() { ...@@ -64,9 +64,9 @@ export default function flexTextMargin_CenterJsunit() {
expect(textMargin03.left).assertEqual(textMargin02.right) expect(textMargin03.left).assertEqual(textMargin02.right)
expect(Math.round(flexTextMargin01.right - textMargin03.right)).assertEqual(vp2px(30)) expect(Math.round(flexTextMargin01.right - textMargin03.right)).assertEqual(vp2px(30))
expect(textMargin01.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin01.bottom) expect(Math.round(textMargin01.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin01.bottom))
expect(textMargin02.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin02.bottom) expect(Math.round(textMargin02.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin02.bottom))
expect(textMargin03.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin03.bottom) expect(Math.round(textMargin03.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin03.bottom))
expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50))
expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100))
expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150))
...@@ -98,15 +98,15 @@ export default function flexTextMargin_CenterJsunit() { ...@@ -98,15 +98,15 @@ export default function flexTextMargin_CenterJsunit() {
expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(vp2px(30)) expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(vp2px(30))
expect(textMargin03.left).assertEqual(textMargin02.right) expect(textMargin03.left).assertEqual(textMargin02.right)
expect(textMargin03.right).assertEqual(flexTextMargin01.right) expect(textMargin03.right).assertEqual(flexTextMargin01.right)
expect(textMargin01.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin01.bottom) expect(Math.round(textMargin01.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin01.bottom))
expect(textMargin02.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin02.bottom) expect(Math.round(textMargin02.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin02.bottom))
expect(textMargin03.top - flexTextMargin01.top).assertEqual(flexTextMargin01.bottom - textMargin03.bottom) expect(Math.round(textMargin03.top - flexTextMargin01.top)).assertEqual(Math.round(flexTextMargin01.bottom - textMargin03.bottom))
expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50))
expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100))
expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150))
expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Center') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Center')
console.info('new testFlexItemAlignCenterSubSetMarginExceed END'); console.info('new testFlexItemAlignCenterSubSetMarginExceed END');
......
...@@ -106,9 +106,9 @@ export default function flexTextMargin_EndJsunit() { ...@@ -106,9 +106,9 @@ export default function flexTextMargin_EndJsunit() {
expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50))
expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100))
expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150))
expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.End') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.End')
console.info('new testFlexItemAlignEndSubSetMarginExceed END'); console.info('new testFlexItemAlignEndSubSetMarginExceed END');
......
...@@ -111,9 +111,9 @@ export default function flexExceed_StartJsunit() { ...@@ -111,9 +111,9 @@ export default function flexExceed_StartJsunit() {
expect(Math.round(textExceed01.bottom - textExceed01.top)).assertEqual(vp2px(50)) expect(Math.round(textExceed01.bottom - textExceed01.top)).assertEqual(vp2px(50))
expect(Math.round(textExceed02.bottom - textExceed02.top)).assertEqual(vp2px(100)) expect(Math.round(textExceed02.bottom - textExceed02.top)).assertEqual(vp2px(100))
expect(Math.round(textExceed03.bottom - textExceed03.top)).assertEqual(vp2px(150)) expect(Math.round(textExceed03.bottom - textExceed03.top)).assertEqual(vp2px(150))
expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(vp2px(440/3)) expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(vp2px(440/3)) expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(vp2px(440/3)) expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start')
console.info('new testFlexItemAlignStartSetMarPadExceed END'); console.info('new testFlexItemAlignStartSetMarPadExceed END');
......
...@@ -110,9 +110,9 @@ export default function flexPadding_StartJsunit() { ...@@ -110,9 +110,9 @@ export default function flexPadding_StartJsunit() {
expect(Math.round(textFlexPadding01.bottom - textFlexPadding01.top)).assertEqual(vp2px(50)) expect(Math.round(textFlexPadding01.bottom - textFlexPadding01.top)).assertEqual(vp2px(50))
expect(Math.round(textFlexPadding02.bottom - textFlexPadding02.top)).assertEqual(vp2px(100)) expect(Math.round(textFlexPadding02.bottom - textFlexPadding02.top)).assertEqual(vp2px(100))
expect(Math.round(textFlexPadding03.bottom - textFlexPadding03.top)).assertEqual(vp2px(150)) expect(Math.round(textFlexPadding03.bottom - textFlexPadding03.top)).assertEqual(vp2px(150))
expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(vp2px(440/3)) expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(vp2px(440/3)) expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(vp2px(440/3)) expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start')
console.info('new testFlexItemAlignStartParentSetPaddingExceed END'); console.info('new testFlexItemAlignStartParentSetPaddingExceed END');
......
...@@ -107,9 +107,9 @@ export default function flexTextMargin_StartJsunit() { ...@@ -107,9 +107,9 @@ export default function flexTextMargin_StartJsunit() {
expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50))
expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100))
expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150))
expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Start')
console.info('new testFlexItemAlignStartSubSetMarginExceed END'); console.info('new testFlexItemAlignStartSubSetMarginExceed END');
......
...@@ -111,9 +111,9 @@ export default function flexExceed_StretchJsunit() { ...@@ -111,9 +111,9 @@ export default function flexExceed_StretchJsunit() {
expect(Math.round(textExceed01.bottom - textExceed01.top)).assertEqual(vp2px(140)) expect(Math.round(textExceed01.bottom - textExceed01.top)).assertEqual(vp2px(140))
expect(Math.round(textExceed02.bottom - textExceed02.top)).assertEqual(vp2px(140)) expect(Math.round(textExceed02.bottom - textExceed02.top)).assertEqual(vp2px(140))
expect(Math.round(textExceed03.bottom - textExceed03.top)).assertEqual(vp2px(140)) expect(Math.round(textExceed03.bottom - textExceed03.top)).assertEqual(vp2px(140))
expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(vp2px(440/3)) expect(Math.round(textExceed01.right - textExceed01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(vp2px(440/3)) expect(Math.round(textExceed02.right - textExceed02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(vp2px(440/3)) expect(Math.round(textExceed03.right - textExceed03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch')
console.info('new testFlexItemAlignStretchSetMarPadExceed END'); console.info('new testFlexItemAlignStretchSetMarPadExceed END');
......
...@@ -112,9 +112,9 @@ export default function flexPadding_StretchJsunit() { ...@@ -112,9 +112,9 @@ export default function flexPadding_StretchJsunit() {
expect(Math.round(textFlexPadding01.bottom - textFlexPadding01.top)).assertEqual(vp2px(140)) expect(Math.round(textFlexPadding01.bottom - textFlexPadding01.top)).assertEqual(vp2px(140))
expect(Math.round(textFlexPadding02.bottom - textFlexPadding02.top)).assertEqual(vp2px(140)) expect(Math.round(textFlexPadding02.bottom - textFlexPadding02.top)).assertEqual(vp2px(140))
expect(Math.round(textFlexPadding03.bottom - textFlexPadding03.top)).assertEqual(vp2px(140)) expect(Math.round(textFlexPadding03.bottom - textFlexPadding03.top)).assertEqual(vp2px(140))
expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(vp2px(440/3)) expect(Math.round(textFlexPadding01.right - textFlexPadding01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(vp2px(440/3)) expect(Math.round(textFlexPadding02.right - textFlexPadding02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(vp2px(440/3)) expect(Math.round(textFlexPadding03.right - textFlexPadding03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch')
console.info('new testFlexItemAlignStretchParentSetPaddingExceed END'); console.info('new testFlexItemAlignStretchParentSetPaddingExceed END');
......
...@@ -110,9 +110,9 @@ export default function flexTextMargin_StretchJsunit() { ...@@ -110,9 +110,9 @@ export default function flexTextMargin_StretchJsunit() {
expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(140)) expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(140))
expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(200)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(200))
expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(200)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(200))
expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3)))
expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(vp2px(440/3)) expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3)))
expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row')
expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Stretch')
console.info('new testFlexItemAlignStretchSubSetMarginExceed END'); console.info('new testFlexItemAlignStretchSubSetMarginExceed END');
......
...@@ -83,9 +83,9 @@ export default function Row_FlexAlign() { ...@@ -83,9 +83,9 @@ export default function Row_FlexAlign() {
expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.Start"); expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.Start");
expect(Text1.left).assertEqual(Row.left); expect(Text1.left).assertEqual(Row.left);
expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom));
expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom));
expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom));
expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10)); expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10));
expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10)); expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10));
...@@ -127,10 +127,10 @@ export default function Row_FlexAlign() { ...@@ -127,10 +127,10 @@ export default function Row_FlexAlign() {
expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.Center"); expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.Center");
expect(Text1.left - Row.left).assertEqual(Row.right - Text3.right); expect(Math.round(Text1.left - Row.left)).assertEqual(Math.round(Row.right - Text3.right));
expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom));
expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom));
expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom));
expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10)); expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10));
expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10)); expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10));
...@@ -171,9 +171,9 @@ export default function Row_FlexAlign() { ...@@ -171,9 +171,9 @@ export default function Row_FlexAlign() {
expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.End"); expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.End");
expect(Text3.right).assertEqual(Row.right); expect(Text3.right).assertEqual(Row.right);
expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom));
expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom));
expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom));
expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10)); expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(10));
expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10)); expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(10));
expect(Text1.left).assertLarger(Row.left); expect(Text1.left).assertLarger(Row.left);
...@@ -218,9 +218,9 @@ export default function Row_FlexAlign() { ...@@ -218,9 +218,9 @@ export default function Row_FlexAlign() {
expect(Text3.right).assertEqual(Row.right); expect(Text3.right).assertEqual(Row.right);
expect(Math.round((Text2.left - Text1.right)*10)/10).assertEqual(vp2px(25)); expect(Math.round((Text2.left - Text1.right)*10)/10).assertEqual(vp2px(25));
expect(Math.round((Text3.left - Text2.right)*10)/10).assertEqual(vp2px(25)); expect(Math.round((Text3.left - Text2.right)*10)/10).assertEqual(vp2px(25));
expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom));
expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom));
expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom));
console.info('testRowJustifyContentFlexAlignSpaceBetween END'); console.info('testRowJustifyContentFlexAlignSpaceBetween END');
done(); done();
...@@ -259,14 +259,14 @@ export default function Row_FlexAlign() { ...@@ -259,14 +259,14 @@ export default function Row_FlexAlign() {
expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.SpaceAround"); expect(obj.$attrs.justifyContent).assertEqual("FlexAlign.SpaceAround");
expect(Text1.left - Row.left).assertEqual(Row.right - Text3.right); expect(Math.round(Text1.left - Row.left)).assertEqual(Math.round(Row.right - Text3.right));
expect(Math.round((Text1.left - Row.left)*10)/10).assertEqual(Math.round(vp2px(50/6)*10)/10); expect(Math.round((Text1.left - Row.left)*10)/10).assertEqual(Math.round(vp2px(50/6)*10)/10);
expect(Math.round(Text2.left - Text1.right)).assertEqual(vp2px(50/3)); expect(Math.round(Text2.left - Text1.right)).assertEqual(Math.round(vp2px(50/3)));
expect(Math.round(Text3.left - Text2.right)).assertEqual(vp2px(50/3)); expect(Math.round(Text3.left - Text2.right)).assertEqual(Math.round(vp2px(50/3)));
expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom));
expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom));
expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom));
console.info('testRowJustifyContentFlexAlignSpaceAround END'); console.info('testRowJustifyContentFlexAlignSpaceAround END');
done(); done();
...@@ -309,9 +309,9 @@ export default function Row_FlexAlign() { ...@@ -309,9 +309,9 @@ export default function Row_FlexAlign() {
expect(Math.round((Text2.left - Text1.right)*100)/100).assertEqual(Math.round(vp2px(50/4)*100)/100); expect(Math.round((Text2.left - Text1.right)*100)/100).assertEqual(Math.round(vp2px(50/4)*100)/100);
expect(Math.round((Text3.left - Text2.right)*100)/100).assertEqual(Math.round(vp2px(50/4)*100)/100); expect(Math.round((Text3.left - Text2.right)*100)/100).assertEqual(Math.round(vp2px(50/4)*100)/100);
expect(Text1.top - Row.top).assertEqual(Row.bottom - Text1.bottom); expect(Math.round(Text1.top - Row.top)).assertEqual(Math.round(Row.bottom - Text1.bottom));
expect(Text2.top - Row.top).assertEqual(Row.bottom - Text2.bottom); expect(Math.round(Text2.top - Row.top)).assertEqual(Math.round(Row.bottom - Text2.bottom));
expect(Text3.top - Row.top).assertEqual(Row.bottom - Text3.bottom); expect(Math.round(Text3.top - Row.top)).assertEqual(Math.round(Row.bottom - Text3.bottom));
console.info('testRowJustifyContentFlexAlignSpaceEvenly END'); console.info('testRowJustifyContentFlexAlignSpaceEvenly END');
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册