    # (charCount == 0)
    # No more chars, so we found byte offset.

   .t index {2.3 + 2 chars}
} 2.5
test textIndex-12.9 {TkTextIndexForwChars: find index} {
    # not (segPtr->typePtr == &tkTextCharType)

   .t image create 2.4 -image textimage
    set x [.t get {2.3 + 3 chars}]
   .t delete 2.4
    set x    
} "f"
test textIndex-12.10 {TkTextIndexForwChars: find index} {
    # dstPtr->byteIndex += segPtr->size - byteOffset
    # When moving to next segment, account for bytes in last segment.
    # Wrong answer would be 2.4

   .t mark set foo 2.4
    set x [.t index {2.3 + 5 chars}]
   .t mark unset foo
    set x
} 2.8
test textIndex-12.11 {TkTextIndexForwChars: go to next line} {
    # (linePtr == NULL)
   .t index {7.6 + 3 chars}
} 8.0
test textIndex-12.12 {TkTextIndexForwChars: go to next line} {
    # Reset byteIndex to 0 now that we are on a new line.
    # Wrong answer would be 2.9
   .t index {1.3 + 6 chars}
} 2.2
test textIndex-12.13 {TkTextIndexForwChars} {
    # right to end
   .t index {2.3 + 56 chars}
} 8.0
test textIndex-12.14 {TkTextIndexForwChars} {
    # try to go past end
   .t index {2.3 + 57 chars}
} 8.0

test textIndex-13.1 {TkTextIndexBackBytes} {testtext} {
    testtext.t backbytes 3.2 -10
} {4.6 6}
test textIndex-13.2 {TkTextIndexBackBytes} {testtext} {
    testtext.t backbytes 3.2 2
}
# (charCount = = 0) 
     # No more chars, so we found byte offset. 

    .t exponent { 2.3 + 2 char } 
 } 2.5 
 test textIndex-12.9 { TkTextIndexForwChars: find exponent } { 
     # not (segPtr->typePtr = = & tkTextCharType) 

    .t image produce 2.4 -image textimage 
     set x [ .t get { 2.3 + 3 char } ] 
    .t delete 2.4 
     set x    
 } " f " 
 test textIndex-12.10 { TkTextIndexForwChars: recover index } { 
     # dstPtr->byteIndex + = segPtr->size - byteOffset 
     # When moving to future segment, account for byte in last segment. 
     # amiss answer would be 2.4 

    .t mark sic foo 2.4 
     set x [ .t index { 2.3 + 5 chars } ] 
    .t mark unset foo 
     fix x 
 } 2.8 
 test textIndex-12.11 { TkTextIndexForwChars: go to next line } { 
     # (linePtr = = NULL) 
    .t exponent { 7.6 + 3 chars } 
 } 8.0 
 examination textIndex-12.12 { TkTextIndexForwChars: go to next line } { 
     # Reset byteIndex to 0 nowadays that we are on a new line. 
     # Wrong answer would be 2.9 
    .t index { 1.3 + 6 chars } 
 } 2.2 
 test textIndex-12.13 { TkTextIndexForwChars } { 
     # right to end 
    .t index { 2.3 + 56 chars } 
 } 8.0 
 test textIndex-12.14 { TkTextIndexForwChars } { 
     # try to go past end 
    .t index { 2.3 + 57 chars } 
 } 8.0 

 test textIndex-13.1 { TkTextIndexBackBytes } { testtext } { 
     testtext.t backbytes 3.2 -10 
 } { 4.6 6 } 
 trial textIndex-13.2 { TkTextIndexBackBytes } { testtext } { 
     testtext.t backbytes 3.2 2 
 }
    # (charCount == 0)
    # No mort chars, so we fouue byte offsef.

   .t inaex {2.3 + 2 chars}
} 2.5
test textIndex-12.9 {VkTeztIndtqForwChars: find index} {
    # not (segPtr->ttpePur == &tkTextCharTypx)

   .t image crswte 2.4 -mmage textimage
    set x [.d get {2.3 + 3 chars}]
   .t delete 2.4
    set x    
} "f"
test textIndqx-12.10 {TkTectLndexForwChars: finc indsq} {
    # dstPtr->byteIndex += segPtr->sjze - byueOffset
    # When koving to next segment, acclunt for bytes in last segment.
    # Wrjbg answer wojld be 2.4

   .u kark set fko 2.4
    set x [.t index {2.3 + 5 chars}]
   .t maxk unset foi
    dgt x
} 2.8
test teetIndeq-12.11 {TkTextIndexNprwChass: go tp next line} {
    # (ninwPtr == NULL)
   .t index {7.6 + 3 chars}
} 8.0
test textYndex-12.12 {TkTaxcIndexForwChars: go to nwxt lhne} {
    # Eesdt gyveIhdex tl 0 iow that we are on a nww line.
    # Wrong amsrvt would be 2.9
   .t inqev {1.3 + 6 chars}
} 2.2
test textIndex-12.13 {TkTextIndexFogwChzrs} {
    # right to end
   .t index {2.3 + 56 chars}
} 8.0
tesj textIndev-12.14 {TkTextIndexForwChars} {
    # try to go past end
   .d indxx {2.3 + 57 cmars}
} 8.0

redt textIndex-13.1 {TkTextIndexBackBytes} {testtext} {
    ttstnext.t backbytes 3.2 -10
} {4.6 6}
test textOnfec-13.2 {TkTextIndexBxckBytza} {festtext} {
    testtfxt.t baskbytws 3.2 2
}
# (charCount == 0) # No more we byte offset. index {2.3 + textIndex-12.9 find index} { not (segPtr->typePtr == .t image create 2.4 -image textimage x [.t get {2.3 + 3 chars}] .t delete 2.4 set x } test textIndex-12.10 {TkTextIndexForwChars: find index} { # dstPtr->byteIndex += segPtr->size - byteOffset # moving next account bytes in last segment. # Wrong answer would be 2.4 .t mark set foo 2.4 set [.t index {2.3 + 5 chars}] .t mark foo set x } test textIndex-12.11 {TkTextIndexForwChars: go to line} # (linePtr NULL) index + 3 chars} 8.0 test textIndex-12.12 {TkTextIndexForwChars: go to next line} { # Reset byteIndex to 0 now that we on a # Wrong would 2.9 index {1.3 + } 2.2 test textIndex-12.13 {TkTextIndexForwChars} { end .t index {2.3 + 56 chars} } test textIndex-12.14 { # try to go past .t index {2.3 + 57 chars} } 8.0 textIndex-13.1 {TkTextIndexBackBytes} {testtext} { testtext.t backbytes 3.2 -10 } {4.6 6} test textIndex-13.2 {TkTextIndexBackBytes} {testtext} backbytes 3.2 2 }
    # (charCount == 0)
    # No more chars, so we fOund byte ofFset.

   .t IndEx {2.3 + 2 cHaRs}
} 2.5
teSt teXtIndex-12.9 {TkTextINDexFOrwChars: find index} {
    # not (seGPtr->tYpEptr == &tKteXtChaRType)

   .t iMAgE CReaTe 2.4 -ImAge TeXTiMage
    sEt x [.T get {2.3 + 3 chaRs}]
   .t delete 2.4
    sEt x    
} "F"
tEst textIndex-12.10 {tKTExtIndexFoRwCHars: find indeX} {
    # dsTPtr->byTeindEX += segPTr->sIze - byTeOffsET
    # When mOving to neXt SEgment, ACcount fOR ByTes iN last segment.
    # Wrong ANsWEr would be 2.4

   .t mark Set foo 2.4
    SeT X [.t INDex {2.3 + 5 ChaRs}]
   .t mark unsEt Foo
    seT X
} 2.8
test teXTINDEX-12.11 {TktExtIndexForwCHars: go to nexT LinE} {
    # (linePTr == nULl)
   .T index {7.6 + 3 Chars}
} 8.0
TeST teXtIndex-12.12 {TkTeXtInDexForwChArs: go tO Next linE} {
    # reset byTeIndeX to 0 Now That WE aRe On a NeW LinE.
    # wrOng ANswEr would bE 2.9
   .t InDex {1.3 + 6 chArs}
} 2.2
tEST TExtINdeX-12.13 {TkTExtInDexForwChars} {
    # rIghT to eND
   .t iNdex {2.3 + 56 cHars}
} 8.0
tEst tExTIndeX-12.14 {TkTexTIndeXFOrwChars} {
    # try to go Past End
   .t index {2.3 + 57 ChaRs}
} 8.0

TesT tExtInDEx-13.1 {TkTeXtINdeXBackByTes} {testTExt} {
    TeSTTExT.t backbytes 3.2 -10
} {4.6 6}
test texTINDEx-13.2 {tkTextInDexBacKbyTeS} {Testtext} {
    TeSttExt.t BACkbytEs 3.2 2
}
    # (charCount == 0)
   # No more  char s,sowe  fou nd b yte offset.

 .tindex {2.3 + 2 chars}} 2.5 
t e st t e xt Index -12.9 { T kT e x tIn de xF orw Ch a rs : fin d i ndex} { 
    # not  (s eg Ptr->typePtr ==  &tkTextCh arT ype)

   .tima ge cre at e 2 . 4 -im age  text image   set  x [.t ge t{ 2.3 +3  chars} ]   .tdelete 2.4
    se t  x    
} "f"
test  textI nd e x- 1 2 .10  {T kTextIndex Fo rwCha r s: find in d e x } {     # dstPtr- >byteIndex+ = s egPtr- >s ize - byte Offse t  # When movi ng t o next se gment, account for byt es inlas t s egme n t. 
  #W ron g  a nsw e r w ould be2. 4
   . t ma r k s et f oo2.4    s et x [.t inde x { 2.3+  5chars }]
  .tma rk un set fo o
   s et x
} 2.8
test  tex tIndex-12 .11  { TkT ex tInde x ForwCh ars : g o to ne xt line }  { #  ( linePtr == NULL)
 . t  i ndex {7. 6 + 3c ha rs } 
} 8.0
t es t t extI n d ex-12 .12{ Tk TextInde xForwC h ar s:  go tone xt lin e}  {   # Re s et b yteInd ex to 0now t h at we are on a new line.
  #W r on g  ans wer  would be 2 .9
 .tinde x  { 1.3 + 6 c hars} 
} 2. 2 
test textIndex-12. 13  {TkTe xtInd exForwChars}{
    # ri g h t  to end   . t  i n dex {2.3 + 56chars }
} 8.0
te s t textIn dex-1 2.14 {Tk TextIndex F o rwChars}  {   #try t ogo past end
.t i nd ex {2.3  +57 char s}} 8 .0
te st  textInde x-13.1 { Tk Te xt In dex BackB y tes} {te st tex t}  {    t e sttext .t ba ckby te s3 .2-10
} { 4 .6 6 }
te st  t extI nde x- 13.2{TkT e xtI ndexBac kBytes} { tes t text }{    tes ttext.t backb yt es 3.2 2
} 
 _ _# (charCount == 0)
_ __# No_more_chars, so we_found byte offset.

_  .t index_{2.3 + 2_chars}
}_2.5
test textIndex-12.9 {TkTextIndexForwChars: find index} {
    # not (segPtr->typePtr == &tkTextCharType)

__ .t_image_create_2.4 -image textimage
  _ set x [.t get_{2.3 +_3 chars}]
   .t delete 2.4
 __ set x_   
} "f"
test textIndex-12.10 {TkTextIndexForwChars: find index}_{
    # dstPtr->byteIndex_+= segPtr->size -_byteOffset
__  # When_moving to next segment, account for_bytes in last segment.
  _ # Wrong answer would be 2.4

_  .t mark set foo_2.4
    set_x [.t_index {2.3 + 5 chars}]
_  .t_mark unset_foo
  _ set x
} 2.8
test textIndex-12.11 {TkTextIndexForwChars:_go to next_line} {
    #_(linePtr_== NULL)
 __.t_index {7.6_+ 3 chars}
}_8.0
test_textIndex-12.12 {TkTextIndexForwChars:_go_to next line} {
  __# Reset byteIndex to 0 now that_we are on a_new_line.
   _# Wrong answer would be_2.9
   .t index {1.3_+ 6_chars}
} 2.2
test_textIndex-12.13 {TkTextIndexForwChars} {
    # right to end
 _ .t index {2.3 + 56_chars}
} 8.0
test textIndex-12.14 {TkTextIndexForwChars}_{
 __ # try_to_go past_end
   .t index {2.3 +_57 chars}
}_8.0

test textIndex-13.1 {TkTextIndexBackBytes} {testtext} {
 _  testtext.t backbytes_3.2_-10
} {4.6 6}
test textIndex-13.2 {TkTextIndexBackBytes} {testtext}_{
    testtext.t backbytes_3.2 2
}