/* Ċ Ġ* ĠCopyright Ġ 2 0 2 1 ĠThe ĠAndroid ĠOpen ĠSource ĠProject Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġandroidx . compose . animation . core Ċ Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . runner . RunWith Ċ import Ġorg . junit . runners . JUnit 4 Ċ Ċ @ RunWith ( JUnit 4 :: class ) Ċ class ĠIs Infinite Test Ġ{ ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Tween Is Finite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġt ween Spec Ġ= Ġt ween < Float >() ĊĠĠĠĠĠĠĠ ĠassertThat ( t ween Spec . vector ize (). isIn finite ). isFalse () ĊĠĠĠĠĠĠĠ ĠassertThat ( t ween Spec . as Animation (). isIn finite ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Snap Is Finite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġsnap Spec Ġ= Ġsnap < Float >() ĊĠĠĠĠĠĠĠ ĠassertThat ( snap Spec . vector ize (). isIn finite ). isFalse () ĊĠĠĠĠĠĠĠ ĠassertThat ( snap Spec . as Animation (). isIn finite ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Key Frames Is Finite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġkey Frames Spec Ġ= Ġkey frames < Float > Ġ{ Ġduration Millis Ġ= Ġ 1 0 0 Ġ} ĊĠĠĠĠĠĠĠ ĠassertThat ( key Frames Spec . vector ize (). isIn finite ). isFalse () ĊĠĠĠĠĠĠĠ ĠassertThat ( key Frames Spec . as Animation (). isIn finite ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Spring Is Finite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġspring Spec Ġ= Ġspring < Float >() ĊĠĠĠĠĠĠĠ Ġval Ġanimation Ġ= Ġspring Spec . as Animation () ĊĠĠĠĠĠĠĠ ĠassertThat ( spring Spec . vector ize (). isIn finite ). isFalse () ĊĠĠĠĠĠĠĠ ĠassertThat ( animation . isIn finite ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Finite Repeat able Is Finite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġspring Ġ= Ġrepeat able ( 1 0 , Ġt ween < Float >()) ĊĠĠĠĠĠĠĠ ĠassertThat ( spring . vector ize (). isIn finite ). isFalse () ĊĠĠĠĠĠĠĠ ĠassertThat ( spring . as Animation (). isIn finite ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Infinite Repeat able IsIn finite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġspring Ġ= Ġinfinite Repeat able ( t ween < Float >()) ĊĠĠĠĠĠĠĠ ĠassertThat ( spring . vector ize (). isIn finite ). isTrue () ĊĠĠĠĠĠĠĠ ĠassertThat ( spring . as Animation (). isIn finite ). isTrue () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Exponent ial Dec ay Animation Is Finite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdecay Spec Ġ= Ġexponential Dec ay < Float >() ĊĠĠĠĠĠĠĠ ĠassertThat ( decay Spec . as Animation (). isIn finite ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġtest Dec ay Animation Is Finite () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġdecay Spec Ġ= ĠFloat Exponent ial Dec ay Spec () ĊĠĠĠĠĠĠĠ ĠassertThat ( decay Spec . as Animation (). isIn finite ). isFalse () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠAnimation Spec < Float >. vector ize (): ĠVector ized Animation Spec < Animation Vector 1 D > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġvector ize ( Float . Vector Converter ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠAnimation Spec < Float >. as Animation (): ĠAnimation < Float , ĠAnimation Vector 1 D > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠTarget Based Animation ( vector ize (), ĠFloat . Vector Converter , Ġ 0 f , Ġ 0 f ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠDec ay Animation Spec < Float >. as Animation (): ĠAnimation < Float , ĠAnimation Vector 1 D > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠDec ay Animation ( this , ĠFloat . Vector Converter , Ġ 0 f , Ġ 0 f ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun ĠFloat Dec ay Animation Spec . as Animation (): ĠAnimation < Float , ĠAnimation Vector 1 D > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠDec ay Animation ( this , Ġ 0 f ) ĊĠĠĠ Ġ} Ċ } Ċ