os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/assocd.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TCL/tcldistribution/tests/assocd.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,78 @@
     1.4 +# This file tests the AssocData facility of Tcl
     1.5 +#
     1.6 +# This file contains a collection of tests for one or more of the Tcl
     1.7 +# built-in commands.  Sourcing this file into Tcl runs the tests and
     1.8 +# generates output for errors.  No output means no errors were found.
     1.9 +#
    1.10 +# Copyright (c) 1991-1994 The Regents of the University of California.
    1.11 +# Copyright (c) 1994 Sun Microsystems, Inc.
    1.12 +# Copyright (c) 1998-1999 by Scriptics Corporation.
    1.13 +#
    1.14 +# See the file "license.terms" for information on usage and redistribution
    1.15 +# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
    1.16 +#
    1.17 +# RCS: @(#) $Id: assocd.test,v 1.5 2000/04/10 17:18:56 ericm Exp $
    1.18 +
    1.19 +if {[lsearch [namespace children] ::tcltest] == -1} {
    1.20 +    package require tcltest
    1.21 +    namespace import -force ::tcltest::*
    1.22 +}
    1.23 +
    1.24 +if {[string compare testsetassocdata [info commands testsetassocdata]] != 0} {
    1.25 +    puts "This application hasn't been compiled with the tests for assocData,"
    1.26 +    puts "therefore I am skipping all of these tests."
    1.27 +    ::tcltest::cleanupTests
    1.28 +    return
    1.29 +}
    1.30 +
    1.31 +test assocd-1.1 {testing setting assoc data} {
    1.32 +   testsetassocdata a 1
    1.33 +} ""
    1.34 +test assocd-1.2 {testing setting assoc data} {
    1.35 +   testsetassocdata a 2
    1.36 +} ""
    1.37 +test assocd-1.3 {testing setting assoc data} {
    1.38 +   testsetassocdata 123 456
    1.39 +} ""
    1.40 +test assocd-1.4 {testing setting assoc data} {
    1.41 +   testsetassocdata abc "abc d e f"
    1.42 +} ""
    1.43 +
    1.44 +test assocd-2.1 {testing getting assoc data} {
    1.45 +   testgetassocdata a
    1.46 +} 2
    1.47 +test assocd-2.2 {testing getting assoc data} {
    1.48 +   testgetassocdata 123
    1.49 +} 456
    1.50 +test assocd-2.3 {testing getting assoc data} {
    1.51 +   testgetassocdata abc
    1.52 +} {abc d e f}
    1.53 +test assocd-2.4 {testing getting assoc data} {
    1.54 +   testgetassocdata xxx
    1.55 +} ""
    1.56 +
    1.57 +test assocd-3.1 {testing deleting assoc data} {
    1.58 +   testdelassocdata a
    1.59 +} ""
    1.60 +test assocd-3.2 {testing deleting assoc data} {
    1.61 +   testdelassocdata 123
    1.62 +} ""
    1.63 +test assocd-3.3 {testing deleting assoc data} {
    1.64 +   list [catch {testdelassocdata nonexistent} msg] $msg
    1.65 +} {0 {}}
    1.66 +
    1.67 +# cleanup
    1.68 +::tcltest::cleanupTests
    1.69 +return
    1.70 +
    1.71 +
    1.72 +
    1.73 +
    1.74 +
    1.75 +
    1.76 +
    1.77 +
    1.78 +
    1.79 +
    1.80 +
    1.81 +