1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
# -*- tcl -*-
# Commands covered: common behaviour of all conversions.
#
# This file contains a collection of tests for one or more of the trf
# commands of the TRF extension. Sourcing this file into Tcl runs the
# tests and generates output for errors. No output means no errors were
# found.
#
# Copyright (c) 1995 Andreas Kupries (andreas_kupries@users.sourceforge.net)
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# $Id: common.conv.test,v 1.2 2000/11/18 22:42:33 aku Exp $
if {[string compare test [info procs test]] == 1} then {source defs}
# conversions: bin, hex, oct, base64, uuencode, ascii85
foreach c {
bin
hex
oct
base64
uuencode
ascii85
} {
test $c-1.0 "$c, argument errors" {
catch {$c XXX} msg; set msg
} {-mode option not set}
test $c-1.1 "$c, argument errors" {
catch {$c -mode} msg; set msg
} "$c: wrong # args, all options require an argument"
test $c-1.2 "$c, argument errors" {
catch {$c -x x} msg; set msg
} {unknown option '-x', should be '-mode'}
test $c-1.3 "$c, argument errors" {
catch {$c -m x} msg; set msg
} {unknown mode 'x', should be 'encode' or 'decode'}
}
|