# -*- tcl -*-
# trim.test:  tests for the textutil package.
#
# This file contains a collection of tests for one or more of the Tcl
# built-in commands.  Sourcing this file into Tcl runs the tests and
# generates output for errors.  No output means no errors were found.
#

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

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

testsNeedTcl     8.5
testsNeedTcltest 1.0

testing {
    useLocal     repeat.tcl   textutil::repeat
}

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

test rep-0.1 {repeat < 0} {
    set str [::textutil::repeat::strRepeat . -1]
    set str
} ""

test rep-0.2 {repeat 0} {
    set str [::textutil::repeat::strRepeat . 0]
    set str 
} ""

test rep-0.3 {repeat 1} {
    set str [::textutil::repeat::strRepeat . 1]
    set str 
} "."

test rep-0.4 {repeat 2} {
    set str [::textutil::repeat::strRepeat . 2]
    set str 
} ".."

test rep-0.5 {repeat 3} {
    set str [::textutil::repeat::strRepeat . 3]
    set str 
} "..."

test rep-0.6 {repeat 5} {
    set str [::textutil::repeat::strRepeat . 5]
    set str 
} "....."

test rep-0.7 {repeat 10} {
    set str [::textutil::repeat::strRepeat . 10]
    set str 
} ".........."

test rep-0.8 {repeat 100} {
    set str [::textutil::repeat::strRepeat . 100]
    set str 
} "...................................................................................................."
