// ĠCopyright Ġ 2 0 0 0 - 2 0 2 1 ĠJetBrains Ġs . r . o . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġorg . intellij . plugins . markdown . actions Ċ Ċ import Ġcom . intellij . openapi . action System . Ide Actions Ċ import Ġcom . intellij . test Framework . Light Platform Code Insight TestCase Ċ import Ġorg . intellij . plugins . markdown . Markdown Testing Util Ċ import Ġorg . junit . Test Ċ Ċ class ĠMarkdown Code Span Extend Word Selection Handler Test : ĠLight Platform Code Insight TestCase () Ġ{ ĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Single Inside One Word () Ġ= Ġdo Test ( ĊĠĠĠ Ġ"` Some Ġ< caret > text `", ĊĠĠĠ Ġ"` Some Ġ< selection >< caret > text </ selection >` ", ĊĠĠĠĠ 1 ĊĠ Ġ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Single Inside All () Ġ= Ġdo Test ( ĊĠĠĠ Ġ"` Some Ġ< caret > text `", ĊĠĠĠ Ġ"` < selection > Some Ġ< caret > text </ selection >` ", ĊĠĠĠĠ 2 ĊĠ Ġ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Single Outside () Ġ= Ġdo Test ( ĊĠĠĠ Ġ"` Some Ġ< caret > text `", ĊĠĠĠ Ġ"< selection >` Some Ġ< caret > text ` </ selection >", ĊĠĠĠĠ 3 ĊĠ Ġ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Double Inside All () Ġ= Ġdo Test ( ĊĠĠĠ Ġ"` Some Ġ< caret > text `", ĊĠĠĠ Ġ"` < selection > Some Ġ< caret > text </ selection >` ", ĊĠĠĠĠ 2 ĊĠ Ġ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Single Mult iline Inside All () Ġ= Ġdo Test ( ĊĠĠĠ Ġ"` Some Ġ< caret > text \ no ther Ġline ? `", ĊĠĠĠ Ġ"` < selection > Some Ġ< caret > text \ no ther Ġline ?</ selection >` ", ĊĠĠĠĠ 3 ĊĠ Ġ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Double Mult iline Inside All () Ġ= Ġdo Test ( ĊĠĠĠ Ġ" `` Some Ġ< caret > text \ no ther Ġline ? `` ", ĊĠĠĠ Ġ" `` < selection > Some Ġ< caret > text \ no ther Ġline ?</ selection > `` ", ĊĠĠĠĠ 3 ĊĠ Ġ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Almost Fence Inside All () Ġ= Ġdo Test ( ĊĠĠĠ Ġ" ``` Some Ġ< caret > text Ġand Ġthe Ġrest ``` ", ĊĠĠĠ Ġ" ``` < selection > Some Ġ< caret > text Ġand Ġthe Ġrest </ selection > ``` ", ĊĠĠĠĠ 2 ĊĠ Ġ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest Almost Fence Outside () Ġ= Ġdo Test ( ĊĠĠĠ Ġ" ``` Some Ġ< caret > text Ġand Ġthe Ġrest ``` ", ĊĠĠĠ Ġ"< selection > ``` Some Ġ< caret > text Ġand Ġthe Ġrest ``` </ selection >", ĊĠĠĠĠ 3 ĊĠ Ġ) ĊĊĠ Ġ@ Test ĊĠ Ġfun Ġtest With Selected () Ġ= Ġdo Test ( ĊĠĠĠ Ġ"` So < selection > me Ġ< caret > text Ġand Ġt </ selection > he Ġrest `", ĊĠĠĠ Ġ"` < selection > Some Ġ< caret > text Ġand Ġthe Ġrest </ selection >` ", ĊĠĠĠĠ 1 ĊĠ Ġ) ĊĊĠ Ġprivate Ġfun Ġdo Test ( before : ĠString , Ġexpected : ĠString , Ġcount : ĠInt ) Ġ{ ĊĠĠĠ Ġconfigure FromFile Text (" test . md ", Ġbefore ) ĊĠĠĠ Ġrepeat ( count ) Ġ{ ĊĠĠĠĠĠ Ġexecute Action ( Ide Actions . ACTION _ EDITOR _ SELECT _ WORD _ AT _ C ARE T ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġcheck Result By Text ( expected ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget TestData Path (): ĠString Ġ{ ĊĠĠĠ Ġreturn ĠMarkdown Testing Util . TEST _ DATA _ PATH Ġ+ Ġ"/ actions / extend Word Selection /" ĊĠ Ġ} Ċ } Ċ