# -*- 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.
#

if {[lsearch [namespace children] ::tcltest] == -1} {
    package require tcltest
    namespace import ::tcltest::*
}

if { [ lsearch [ namespace children ] "::textutil" ] == -1 } then {
    source [file join [file dirname [info script]] textutil.tcl]
}

###################################################

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

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

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

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

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

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

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

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