CRIMP
Artifact [ed66b1cb20]
Not logged in

Artifact ed66b1cb2073ef317648ca6ee344f1ede66628da:


# add.test -*- tcl -*-
# -------------------------------------------------------------------------

source [file join \
            [file dirname [file join [pwd] [info script]]] \
            testutilities.tcl]

testsNeedTcl     8.5
testsNeedTcltest 2

support {
    useC [mainPath _test/lib]/crimp_core* crimp::core no
}
testing {
    useC [mainPath _test/lib]/crimp* crimp no
}

# -------------------------------------------------------------------------

test crimp-bwvertical-1.0 {Black/White Checker Board} -body {
    set image [crimp::black_white_vertical]
    crimp write 2string tcl $image
} -cleanup {
    unset image
} -result [::apply {{} {
    set b [lrepeat 16 0]
    set w [lrepeat 16 255]

    set bw [list {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w]
    set wb [list {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b {*}$w {*}$b]

    set bw [lrepeat 16 $bw]
    set wb [lrepeat 16 $wb]

    return [list {*}$wb {*}$bw {*}$wb {*}$bw {*}$wb {*}$bw {*}$wb {*}$bw {*}$wb {*}$bw {*}$wb {*}$bw {*}$wb {*}$bw {*}$wb {*}$bw]
}}]

test crimp-bwvertical-1.1 {Black/White Checker Board, wrong#args, too many} -body {
    crimp::black_white_vertical X
} -returnCodes error -result {wrong # args: should be "crimp::black_white_vertical "}

# -------------------------------------------------------------------------
testsuiteCleanup

# Local variables:
# mode: tcl
# indent-tabs-mode: nil
# End: