Skip to content

Commit

Permalink
Add test for -0.0 float
Browse files Browse the repository at this point in the history
Summary:
This was an idea to check by Joshua Gross

Changelog:
[General][Internal] Codegen: Adding test for negative zero floats

Reviewed By: JoshuaGross

Differential Revision: D14378418

fbshipit-source-id: 4d18eea18143c501d3f2e7ba334f35ec1dd140e6
  • Loading branch information
elicwhite authored and facebook-github-bot committed Mar 8, 2019
1 parent 544d9fb commit e3b2818
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ const FLOAT_PROPS: SchemaType = {
default: 1,
},
},
{
name: 'blurRadius6',
optional: true,
typeAnnotation: {
type: 'FloatTypeAnnotation',
default: -0.0,
},
},
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ FloatPropNativeComponentProps::FloatPropNativeComponentProps(
blurRadius2(convertRawProp(rawProps, \\"blurRadius2\\", sourceProps.blurRadius2, blurRadius2)),
blurRadius3(convertRawProp(rawProps, \\"blurRadius3\\", sourceProps.blurRadius3, blurRadius3)),
blurRadius4(convertRawProp(rawProps, \\"blurRadius4\\", sourceProps.blurRadius4, blurRadius4)),
blurRadius5(convertRawProp(rawProps, \\"blurRadius5\\", sourceProps.blurRadius5, blurRadius5))
blurRadius5(convertRawProp(rawProps, \\"blurRadius5\\", sourceProps.blurRadius5, blurRadius5)),
blurRadius6(convertRawProp(rawProps, \\"blurRadius6\\", sourceProps.blurRadius6, blurRadius6))
{}
} // namespace react
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ const Float blurRadius2{0.001};
const Float blurRadius3{2.1};
const Float blurRadius4{0.0};
const Float blurRadius5{1.0};
const Float blurRadius6{0.0};
};
} // namespace react
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ const FloatPropNativeComponentViewConfig = {
blurRadius3: true,
blurRadius4: true,
blurRadius5: true,
blurRadius6: true,
style: ReactNativeStyleAttributes
}
};
Expand Down

0 comments on commit e3b2818

Please sign in to comment.