summaryrefslogtreecommitdiffstats
path: root/Python/structmember.c
Commit message (Expand)AuthorAgeFilesLines
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-274/+274
* Merged revisions 79763 via svnmerge fromBenjamin Peterson2010-04-041-1/+1
* Merged revisions 79642,79644 via svnmerge fromBenjamin Peterson2010-04-031-1/+5
* Issue #8014: Fix incorrect error checks in structmember.c, and re-enableMark Dickinson2010-03-131-3/+4
* Merged revisions 77157 via svnmerge fromBenjamin Peterson2009-12-301-5/+15
* Rename PyUnicode_AsString -> _PyUnicode_AsString andMarc-André Lemburg2008-08-071-1/+1
* Issue #1950: Fixed misusage of PyUnicode_AsString().Alexandre Vassalotti2008-05-031-4/+11
* Merged revisions 60176-60209 via svnmerge fromChristian Heimes2008-01-231-0/+15
* Cleanup: Replaced most PyInt_ aliases with PyLong_ and disabled the aliases i...Christian Heimes2007-12-021-12/+12
* This is the uncontroversial half of patch 1263 by Thomas Lee:Guido van Rossum2007-10-191-5/+5
* PyErr_Warn is deprecated in 2.5 - goes away for 3.0Skip Montanaro2007-08-121-4/+4
* Remove support for __members__ and __methods__. There still might beNeal Norwitz2007-08-111-66/+0
* Merged revisions 56753-56781 via svnmerge fromGuido van Rossum2007-08-061-30/+31
* Merged revisions 55962-56019 via svnmerge fromGuido van Rossum2007-06-181-0/+10
* Merged revisions 55817-55961 via svnmerge fromGuido van Rossum2007-06-131-24/+18
* Merged revisions 55270-55324 via svnmerge fromGuido van Rossum2007-05-141-9/+1
* Make readonly members defined in C throw an AttributeError on modification. T...Collin Winter2007-03-281-1/+1
* Four months of trunk changes (including a few releases...)Thomas Wouters2006-12-131-53/+91
* Completely get rid of PyClass and PyInstance.Guido van Rossum2006-08-171-0/+4
* Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk.Thomas Wouters2006-05-271-4/+7
* const poisoning, spreading to fix new const warningsTim Peters2005-12-241-3/+3
* Patch #1115086: support PY_LONGLONG in structmember.Martin v. Löwis2005-03-031-0/+32
* Getting rid of all the code inside #ifdef macintosh too.Jack Jansen2003-11-201-22/+1
* Fix SF bug #486144: Uninitialized __slot__ vrbl is None.Guido van Rossum2001-12-041-1/+8
* Put descr name in "bad memberdescr type" error message.Jeremy Hylton2001-10-161-1/+2
* Add optional docstrings to member descriptors. For backwardsGuido van Rossum2001-09-201-202/+213
* Add support for restricting access based on restricted execution mode.Guido van Rossum2001-09-171-5/+16
* SF bug http://sourceforge.net/bugs/?func=detailbug&bug_id=130242&group_id=5470Tim Peters2001-01-271-0/+1
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
* Mass ANSIfication of function definitions. Doesn't cover all 'extern'Thomas Wouters2000-07-221-11/+3
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
* Change copyright notice.Guido van Rossum2000-06-301-21/+6
* Trivial little change: when setting a member to an object, hold theGuido van Rossum1998-05-201-1/+3
* Quickly renamed the remaining files -- this directory is done.Guido van Rossum1997-04-291-78/+88
* Tweaks to keep the Microsoft compiler quier.Guido van Rossum1997-04-091-6/+8
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-12/+19
* Added 1995 to copyright message.Guido van Rossum1995-01-041-2/+2
* - Added ability to get at strings embedded in the structJack Jansen1994-12-141-1/+23
* Merge back to main trunkGuido van Rossum1994-08-301-1/+6
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-2/+2
* Added new types to setattr() as well...Guido van Rossum1992-06-031-0/+52
* Copyright for 1992 addedGuido van Rossum1992-04-051-1/+1
* Use new exceptions.Guido van Rossum1991-12-101-3/+3
* Added __members__ secret attributeGuido van Rossum1991-10-201-0/+25
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
* Return -1 for errors.Guido van Rossum1990-12-201-1/+1
* "Compiling" versionGuido van Rossum1990-12-201-0/+134
'>hypnotoad_prefer_native_8_6 Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
path: root/tests/lindex.test
blob: a4596c5d0868c703fb19fb8c322190e3ad09b19e (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Commands covered:  lindex
#
# 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.
#
# Copyright (c) 1991-1993 The Regents of the University of California.
# Copyright (c) 1994 Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: lindex.test,v 1.2 1998/09/14 18:40:11 stanton Exp $

if {[string compare test [info procs test]] == 1} then {source defs}

test lindex-1.1 {basic tests} {
    lindex {a b c} 0} a
test lindex-1.2 {basic tests} {
    lindex {a {b c d} x} 1} {b c d}
test lindex-1.3 {basic tests} {
    lindex {a b\ c\ d x} 1} {b c d}
test lindex-1.4 {basic tests} {
    lindex {a b c} 3} {}
test lindex-1.5 {basic tests} {
    list [catch {lindex {a b c} -1} msg] $msg
} {0 {}}
test lindex-1.6 {basic tests} {
    lindex {a b c d} end
} d
test lindex-1.7 {basic tests} {
    lindex {a b c d} 100
} {}
test lindex-1.8 {basic tests} {
    lindex {a} e
} a
test lindex-1.9 {basic tests} {
    lindex {} end
} {}
test lindex-1.10 {basic tests} {
    lindex {a b c d} 3
} d

test lindex-2.1 {error conditions} {
    list [catch {lindex msg} msg] $msg
} {1 {wrong # args: should be "lindex list index"}}
test lindex-2.2 {error conditions} {
    list [catch {lindex 1 2 3 4} msg] $msg
} {1 {wrong # args: should be "lindex list index"}}
test lindex-2.3 {error conditions} {
    list [catch {lindex 1 2a2} msg] $msg
} {1 {bad index "2a2": must be integer or "end"}}
test lindex-2.4 {error conditions} {
    list [catch {lindex "a \{" 2} msg] $msg
} {1 {unmatched open brace in list}}
test lindex-2.5 {error conditions} {
    list [catch {lindex {a {b c}d e} 2} msg] $msg
} {1 {list element in braces followed by "d" instead of space}}
test lindex-2.6 {error conditions} {
    list [catch {lindex {a "b c"def ghi} 2} msg] $msg
} {1 {list element in quotes followed by "def" instead of space}}

test lindex-3.1 {quoted elements} {
    lindex {a "b c" d} 1
} {b c}
test lindex-3.2 {quoted elements} {
    lindex {"{}" b c} 0
} {{}}
test lindex-3.3 {quoted elements} {
    lindex {ab "c d \" x" y} 1
} {c d " x}
test lindex-3.4 {quoted elements} {
    lindex {a b {c d "e} {f g"}} 2
} {c d "e}