#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------

test blocks-1.1 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list "Apa 2" "Bepa 2" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {c c c}

test blocks-1.2 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1"         "Cepa 1"]
    set b2 [list         "Bepa 2" "Gurka" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {d c a c}

test blocks-1.3 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list                  "Cepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d d c a}

test blocks-1.4 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list         "Bepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d c C}

test blocks-1.5 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1" "Depa 1"]
    set b2 [list         "Bepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d c C d}

test blocks-1.6 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1"         "Cepa 1" "Depa 1"]
    set b2 [list         "Bepa 2" "Apa 2" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {d c a c d}

# A big block
test blocks-1.7 {
    Change-block parsing
} -body {
    set b1 {a}
    set b2 {}
    for {set t 0} {$t < 40} {incr t} {
        lappend b1 $t
        lappend b2 $t
    }
    lappend b2 a
    compareBlocks $b1 $b2
} -result {d c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c a}

# This is designed to be complex enough to trigger the innermost loop
test blocks-1.8 {
    Change-block parsing, complex case
} -body {
    set b1 [list a 4              10    0 14 6 0 4 13 16 11]
    set b2 [list   3 1 7 12 11 17 10 15 0             16 a]
    compareBlocks $b1 $b2
} -result  [list d C a a a  a  a  c  a  c d  d d d d  c  C]
