package Ġorg . opp ia . android . scripts . regex Ċ Ċ import Ġcom . google . common . truth . Truth . assertThat Ċ import Ġorg . junit . After Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . rules . Temporary Folder Ċ import Ġorg . opp ia . android . testing . assert Throws Ċ import Ġjava . io . ByteArray OutputStream Ċ import Ġjava . io . File Ċ import Ġjava . io . Print Stream Ċ Ċ /** ĠTests Ġfor Ġ[ Regex Pattern Validation Check ]. Ġ*/ Ċ class ĠRegex Pattern Validation Check Test Ġ{ ĊĠ Ġprivate Ġval Ġout Content : ĠByteArrayOutputStream Ġ= ĠByteArrayOutputStream () ĊĠ Ġprivate Ġval Ġoriginal Out : ĠPrint Stream Ġ= ĠSystem . out ĊĠ Ġprivate Ġval ĠREG EX _ CHECK _ PAS SED _ OUTPUT _ IND IC ATOR : ĠString Ġ= Ġ" REGEX ĠP ATTERN ĠCHECK S ĠPAS SED " ĊĠ Ġprivate Ġval ĠREG EX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR : ĠString Ġ= Ġ" REGEX ĠP ATTERN ĠCHECK S ĠFAILED " ĊĠ Ġprivate Ġval Ġsupport Library Usage ErrorMessage Ġ= ĊĠĠĠ Ġ" Android X Ġshould Ġbe Ġused Ġinstead Ġof Ġthe Ġsupport Ġlibrary " ĊĠ Ġprivate Ġval Ġcoroutine Worker Usage ErrorMessage Ġ= ĊĠĠĠ Ġ" For Ġstable Ġtests , Ġprefer Ġusing ĠList enable Worker Ġwith Ġan ĠO pp ia - managed Ġdispatcher ." ĊĠ Ġprivate Ġval Ġset table Future Usage ErrorMessage Ġ= ĊĠĠĠ Ġ" Set table Future Ġshould Ġonly Ġbe Ġused Ġin Ġpre - approved Ġlocations Ġsince Ġit 's Ġeasy Ġto Ġpotentially " Ġ+ ĊĠĠĠĠĠ Ġ" Ġmess Ġup Ġ& Ġlead Ġto Ġa Ġh anging ĠList enable Future ." ĊĠ Ġprivate Ġval Ġandroid Gravity Left ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġandroid : gravity =\" start \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Gravity Right ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġandroid : gravity =\" end \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Layout Gravity Left ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġandroid : layout _ gravity =\" start \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Layout Gravity Right ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġandroid : layout _ gravity =\" end \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Generic Start End R tl ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġstart / end Ġversions Ġof Ġlayout Ġproperties , Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Barrier Direction Left ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġapp : barrier Direction =\" start \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Barrier Direction Right ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġapp : barrier Direction =\" end \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Drag Direction Left ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġmotion : drag Direction =\" start \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Drag Direction Right ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġmotion : drag Direction =\" end \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Touch Anchor Side Left ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġmotion : touch Anchor Side =\" start \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġandroid Touch Anchor Side Right ErrorMessage Ġ= ĊĠĠĠ Ġ" Use Ġmotion : touch Anchor Side =\" end \", Ġinstead , Ġfor Ġproper ĠRTL Ġsupport " ĊĠ Ġprivate Ġval Ġopp ia C ant Be Translated ErrorMessage Ġ= ĊĠĠĠ Ġ" Opp ia Ġshould Ġnever Ġused Ġdirectly Ġin Ġa Ġstring Ġ( since Ġit Ġshouldn 't Ġbe Ġtranslated ). ĠInstead ," Ġ+ ĊĠĠĠĠĠ Ġ" Ġuse Ġa Ġparameter Ġ& Ġinsert Ġthe Ġstring Ġretrieved Ġfrom Ġapp _ name ." ĊĠ Ġprivate Ġval Ġun trans latable Strings Go In Specific File ErrorMessage Ġ= ĊĠĠĠ Ġ" Un trans latable Ġstrings Ġshould Ġgo Ġin Ġun translated _ strings . xml , Ġinstead ." ĊĠ Ġprivate Ġval Ġtrans latable Strings Go In Main File ErrorMessage Ġ= ĊĠĠĠ Ġ" All Ġstrings Ġoutside Ġstrings . xml Ġmust Ġbe Ġmarked Ġas Ġnot Ġtrans latable , Ġor Ġmoved Ġto Ġstrings . xml ." ĊĠ Ġprivate Ġval Ġwiki Reference Note Ġ= ĊĠĠĠ Ġ" Refer Ġto Ġhttps :// github . com / opp ia / opp ia - android / wiki / Static - Analysis - Checks " Ġ+ ĊĠĠĠĠĠ Ġ"# regex pattern validation - check Ġfor Ġmore Ġdetails Ġon Ġhow Ġto Ġfix Ġthis ." ĊĊĠ Ġ@ Rule ĊĠ Ġ@ Jvm Field ĊĠ Ġvar Ġtemp Folder Ġ= ĠTemporary Folder () ĊĊĠ Ġ@ Before ĊĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠ Ġtemp Folder . new Folder (" test files ") ĊĠĠĠ ĠSystem . set Out ( Print Stream ( out Content )) ĊĠ Ġ} ĊĊĠ Ġ@ After ĊĠ Ġfun Ġrestore Streams () Ġ{ ĊĠĠĠ ĠSystem . set Out ( original Out ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileName Pattern _ activity In App Module _ fileName Pattern Is Correct () Ġ{ ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" app ", Ġ" src ", Ġ" main ") ĊĠĠĠ Ġtemp Folder . new File (" test files / app / src / main / Test Activity . kt ") ĊĊĠĠĠ Ġrun Script () ĊĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()). isEqualTo ( REGEX _ CHECK _ PAS SED _ OUTPUT _ IND IC ATOR ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileName Pattern _ activity In Testing Module _ fileName Pattern Is Correct () Ġ{ ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" testing ", Ġ" src ", Ġ" main ") ĊĠĠĠ Ġtemp Folder . new File (" test files / testing / src / main / Test Activity . kt ") ĊĊĠĠĠ Ġrun Script () ĊĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()). isEqualTo ( REGEX _ CHECK _ PAS SED _ OUTPUT _ IND IC ATOR ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileName Pattern _ activity In Data Module _ fileName Pattern IsNot Correct () Ġ{ ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" data ", Ġ" src ", Ġ" main ") ĊĠĠĠ Ġtemp Folder . new File (" test files / data / src / main / Test Activity . kt ") ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()). isEqualTo ( ĊĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠ ĠFile Ġname / path Ġviolation : ĠActiv ities Ġcannot Ġbe Ġplaced Ġoutside Ġthe Ġapp Ġor Ġtesting Ġmodule ĊĠĠĠĠĠ Ġ- Ġdata / src / main / Test Activity . kt ĊĠĠĠĠĠĠĊĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ empty File _ file Content Is Correct () Ġ{ ĊĠĠĠ Ġtemp Folder . new File (" test files / Test File . kt ") ĊĊĠĠĠ Ġrun Script () ĊĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()). isEqualTo ( REGEX _ CHECK _ PAS SED _ OUTPUT _ IND IC ATOR ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ support Library Import _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" import Ġandroid . support . v 7 . app " ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / Test File . kt ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ ĠTest File . kt : 1 : Ġ$ support Library Usage ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ coroutine Worker _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ") Ġ: ĠCor outine Worker ( context , Ġparams ) Ġ{" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / Test File . kt ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ ĠTest File . kt : 1 : Ġ$ coroutine Worker Usage ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ set table Future _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" Set table Future . create < Result >() " ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / Test File . kt ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ ĠTest File . kt : 1 : Ġ$ set table Future Usage ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Gravity Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : gravity =\" left \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Gravity Left ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Gravity Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : gravity =\" right \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Gravity Right ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Gravity Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ gravity =\" left \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Layout Gravity Left ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Gravity Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ gravity =\" right \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Layout Gravity Right ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Padding Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : padding Left =\" 1 6 dp \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Padding Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : padding Right =\" 1 6 dp \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Drawable Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : drawable Left =\" @ android : color / transparent \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Drawable Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : drawable Right =\" @ android : color / transparent \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Align Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ align Left =\" @ + id / another _ view \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Align Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ align Right =\" @ + id / another _ view \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Margin Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ margin Left =\" 1 6 dp \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Margin Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ margin Right =\" 1 6 dp \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Align Parent Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ align Parent Left =\" true \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Align Parent Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ align Parent Right =\" true \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout To Left Of _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ to Left Of =\" @ + id / another _ view \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout To Right Of _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ to Right Of =\" @ + id / another _ view \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Constraint Left To Left Of _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ constraint Left _ to Left Of =\" @ + id / another _ view \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Constraint Left To Right Of _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ constraint Left _ to Right Of =\" @ + id / another _ view \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Constraint Right To Left Of _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ constraint Right _ to Left Of =\" @ + id / another _ view \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout Constraint Right To Right Of _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ constraint Right _ to Right Of =\" @ + id / another _ view \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout G one Margin Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ g one Margin Left =\" 1 6 dp \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ android Layout G one Margin Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" android : layout _ g one Margin Right =\" 1 6 dp \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Generic Start End R tl ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ app Barrier Direction Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" app : barrier Direction =\" left \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Barrier Direction Left ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ app Barrier Direction Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" app : barrier Direction =\" right \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Barrier Direction Right ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ app Drag Direction Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" motion : drag Direction =\" left \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Drag Direction Left ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ app Drag Direction Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" motion : drag Direction =\" right \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Drag Direction Right ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ app Touch Anchor Side Left _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" motion : touch Anchor Side =\" left \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Touch Anchor Side Left ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ app Touch Anchor Side Right _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" motion : touch Anchor Side =\" right \"" ĊĠĠĠ Ġval Ġfile Contains Support Library Import Ġ= Ġtemp Folder . new File (" test files / test _ layout . xml ") ĊĠĠĠ Ġfile Contains Support Library Import . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġtest _ layout . xml : 1 : Ġ$ android Touch Anchor Side Right ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ opp ia In String _ in Primary Strings File _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ"< string Ġname =\" test \"> String Ġwith ĠO pp ia Ġin Ġit </ string >" ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" app ", Ġ" src ", Ġ" main ", Ġ" res ", Ġ" values ") ĊĠĠĠ Ġval Ġstring FilePath Ġ= Ġ" app / src / main / res / values / strings . xml " ĊĠĠĠ Ġtemp Folder . new File (" test files /$ string FilePath "). write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġ$ string FilePath : 1 : Ġ$ opp ia C ant Be Translated ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ un trans latable String _ in Primary Strings File _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ"< string Ġname =\" test \" Ġtrans latable =\" false \"> Something </ string >" ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" app ", Ġ" src ", Ġ" main ", Ġ" res ", Ġ" values ") ĊĠĠĠ Ġval Ġstring FilePath Ġ= Ġ" app / src / main / res / values / strings . xml " ĊĠĠĠ Ġtemp Folder . new File (" test files /$ string FilePath "). write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġ$ string FilePath : 1 : Ġ$ un trans latable Strings Go In Specific File ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ un trans latable String _ in Un translated Strings File _ file Content Is Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ"< string Ġname =\" test \" Ġtrans latable =\" false \"> Something </ string >" ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" app ", Ġ" src ", Ġ" main ", Ġ" res ", Ġ" values ") ĊĠĠĠ Ġval Ġstring FilePath Ġ= Ġ" app / src / main / res / values / un translated _ strings . xml " ĊĠĠĠ Ġtemp Folder . new File (" test files /$ string FilePath "). write Text ( pro hibited Content ) ĊĊĠĠĠ Ġrun Script () ĊĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()). isEqualTo ( REGEX _ CHECK _ PAS SED _ OUTPUT _ IND IC ATOR ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ trans latable String _ outside Primary Strings File _ file Content IsNot Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ"< string Ġname =\" test \"> Trans latable </ string >" ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" app ", Ġ" src ", Ġ" main ", Ġ" res ", Ġ" values ") ĊĠĠĠ Ġval Ġstring FilePath Ġ= Ġ" app / src / main / res / values / un translated _ strings . xml " ĊĠĠĠ Ġtemp Folder . new File (" test files /$ string FilePath "). write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()) ĊĠĠĠĠĠ Ġ. isEqualTo ( ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠ Ġ$ string FilePath : 1 : Ġ$ trans latable Strings Go In Main File ErrorMessage ĊĠĠĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest FileContent _ un trans latable String _ outside Primary Strings File _ file Content Is Correct () Ġ{ ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ"< string Ġname =\" test \"> Trans latable </ string >" ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" app ", Ġ" src ", Ġ" main ", Ġ" res ", Ġ" values ") ĊĠĠĠ Ġval Ġstring FilePath Ġ= Ġ" app / src / main / res / values / strings . xml " ĊĠĠĠ Ġtemp Folder . new File (" test files /$ string FilePath "). write Text ( pro hibited Content ) ĊĊĠĠĠ Ġrun Script () ĊĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()). isEqualTo ( REGEX _ CHECK _ PAS SED _ OUTPUT _ IND IC ATOR ) ĊĠ Ġ} ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Filename And Content _ use Pro hibited FileName _ use Pro hibited FileContent _ multiple Failures () Ġ{ ĊĠĠĠ Ġtemp Folder . new Folder (" test files ", Ġ" data ", Ġ" src ", Ġ" main ") ĊĠĠĠ Ġval Ġpro hibited File Ġ= Ġtemp Folder . new File (" test files / data / src / main / Test Activity . kt ") ĊĠĠĠ Ġval Ġpro hibited Content Ġ= Ġ" import Ġandroid . support . v 7 . app " ĊĠĠĠ Ġpro hibited File . write Text ( pro hibited Content ) ĊĊĠĠĠ Ġval Ġexception Ġ= ĠassertThrows ( Exception :: class ) Ġ{ ĊĠĠĠĠĠ Ġrun Script () ĊĠĠĠ Ġ} ĊĊĠĠĠ ĠassertThat ( exception ). has Message That (). contains ( REGEX _ CHECK _ FAILED _ OUTPUT _ IND IC ATOR ) ĊĠĠĠ ĠassertThat ( out Content . toString (). trim ()). isEqualTo ( ĊĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠ ĠFile Ġname / path Ġviolation : ĠActiv ities Ġcannot Ġbe Ġplaced Ġoutside Ġthe Ġapp Ġor Ġtesting Ġmodule ĊĠĠĠĠĠ Ġ- Ġdata / src / main / Test Activity . kt ĊĊĠĠĠĠĠ Ġdata / src / main / Test Activity . kt : 1 : ĠAndroid X Ġshould Ġbe Ġused Ġinstead Ġof Ġthe Ġsupport Ġlibrary ĊĠĠĠĠĠ Ġ$ wiki Reference Note ĊĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ/** ĠRuns Ġthe Ġregex _ pattern _ validation _ check . Ġ*/ ĊĠ Ġprivate Ġfun Ġrun Script () Ġ{ ĊĠĠĠ Ġmain ( File ( temp Folder . root , Ġ" test files "). absolute Path ) ĊĠ Ġ} Ċ } Ċ