cvsuser 04/12/08 21:54:45
Modified: . MANIFEST
languages/tcl TODO
languages/tcl/lib list.imc
Added: languages/tcl/t cmd_lappend.t cmd_linsert.t cmd_list.t
cmd_llength.t
Log:
Add more tcl tests (and fix a minor bug in the list error handling)
Revision Changes Path
1.803 +4 -0 parrot/MANIFEST
Index: MANIFEST
===================================================================
RCS file: /cvs/public/parrot/MANIFEST,v
retrieving revision 1.802
retrieving revision 1.803
diff -u -r1.802 -r1.803
--- MANIFEST 7 Dec 2004 21:38:59 -0000 1.802
+++ MANIFEST 9 Dec 2004 05:54:42 -0000 1.803
@@ -2521,6 +2521,10 @@
languages/tcl/t/cmd_format.t [tcl]
languages/tcl/t/cmd_if.t [tcl]
languages/tcl/t/cmd_incr.t [tcl]
+languages/tcl/t/cmd_lappend.t [tcl]
+languages/tcl/t/cmd_linsert.t [tcl]
+languages/tcl/t/cmd_list.t [tcl]
+languages/tcl/t/cmd_llength.t [tcl]
languages/tcl/t/cmd_proc.t [tcl]
languages/tcl/t/cmd_puts.t [tcl]
languages/tcl/t/cmd_rename.t [tcl]
1.24 +1 -2 parrot/languages/tcl/TODO
Index: TODO
===================================================================
RCS file: /cvs/public/parrot/languages/tcl/TODO,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- TODO 9 Dec 2004 05:12:03 -0000 1.23
+++ TODO 9 Dec 2004 05:54:43 -0000 1.24
@@ -149,9 +149,8 @@
=item Add tests for...
tclword.imc tcl*.pmc
-[concat] [join] [list] [llength] [lappend] [linsert] [lrepeat]
+[concat] [join] [lrepeat] [uplevel] [upvar]
[lrange] [array set] [global] [string match] [inline]
-[uplevel] [upvar]
the macros?
expr's precedence and parens
[puts]'s ability to write to other channels.
1.2 +1 -1 parrot/languages/tcl/lib/list.imc
Index: list.imc
===================================================================
RCS file: /cvs/public/parrot/languages/tcl/lib/list.imc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- list.imc 28 Nov 2004 04:29:31 -0000 1.1
+++ list.imc 9 Dec 2004 05:54:44 -0000 1.2
@@ -43,7 +43,7 @@
retval = new TclString
$S9 = "bad index \""
$S9 .= position
- $S9 .= "\": must be integer or end?-integer?"
+ $S9 .= "\": must be integer or end?-integer?\n"
retval = $S9
return_type=TCL_ERROR
goto done
1.1 parrot/languages/tcl/t/cmd_lappend.t
Index: cmd_lappend.t
===================================================================
#!/usr/bin/perl
use strict;
use lib qw(tcl/t t . ../lib ../../lib ../../../lib);
use Parrot::Test tests => 3;
use vars qw($TODO);
language_output_is("tcl",<<'TCL',<<OUT,"append nothing");
set a [list a b]
lappend a
puts $a
TCL
a b
OUT
language_output_is("tcl",<<'TCL',<<OUT,"append one");
set a [list a b]
lappend a c
puts $a
TCL
a b c
OUT
language_output_is("tcl",<<'TCL',<<OUT,"append multiple");
set a [list a b]
lappend a c d e f g
puts $a
TCL
a b c d e f g
OUT
1.1 parrot/languages/tcl/t/cmd_linsert.t
Index: cmd_linsert.t
===================================================================
#!/usr/bin/perl
use strict;
use lib qw(tcl/t t . ../lib ../../lib ../../../lib);
use Parrot::Test tests => 5;
use vars qw($TODO);
language_output_is("tcl",<<'TCL',<<OUT,"insert beginning empty list");
set a [list]
puts [linsert $a 0 a]
TCL
a
OUT
TODO: {
local $TODO = "borked.";
language_output_is("tcl",<<'TCL',<<OUT,"insert beyond end of empty list");
set a [list]
puts [linsert $a 20 a]
TCL
a
OUT
}
language_output_is("tcl",<<'TCL',<<OUT,"insert end single list");
set a [list a]
puts [linsert $a end b]
TCL
a b
OUT
language_output_is("tcl",<<'TCL',<<OUT,"insert middle double list");
set a [list a c]
puts [linsert $a end-1 b]
TCL
a b c
OUT
language_output_is("tcl",<<'TCL',<<OUT,"insert bad index");
set a [list a c]
puts [linsert $a q b]
TCL
bad index "q": must be integer or end?-integer?
OUT
1.1 parrot/languages/tcl/t/cmd_list.t
Index: cmd_list.t
===================================================================
#!/usr/bin/perl
use strict;
use lib qw(tcl/t t . ../lib ../../lib ../../../lib);
use Parrot::Test tests => 5;
use vars qw($TODO);
language_output_is("tcl",<<'TCL',<<OUT,"no elements");
puts [list]
TCL
OUT
language_output_is("tcl",<<'TCL',<<OUT,"one element");
puts [list a]
TCL
a
OUT
language_output_is("tcl",<<'TCL',<<OUT,"two elements");
puts [list a b]
TCL
a b
OUT
TODO: {
local $TODO = "spaces in elements don't force braces.";
language_output_is("tcl",<<'TCL',<<OUT,"braces");
puts [list a b {c {d e}}]
TCL
a b {c {d e}}
OUT
language_output_is("tcl",<<'TCL',<<OUT,"spaces");
puts [list a b "c {d e}"]
TCL
a b {c {d e}}
OUT
}
1.1 parrot/languages/tcl/t/cmd_llength.t
Index: cmd_llength.t
===================================================================
#!/usr/bin/perl
use strict;
use lib qw(tcl/t t . ../lib ../../lib ../../../lib);
use Parrot::Test tests => 5;
use vars qw($TODO);
language_output_is("tcl",<<'TCL',<<OUT,"no elements");
puts [llength [list]]
TCL
0
OUT
language_output_is("tcl",<<'TCL',<<OUT,"one element");
puts [llength [list a]]
TCL
1
OUT
language_output_is("tcl",<<'TCL',<<OUT,"two elements");
puts [llength [list a b]]
TCL
2
OUT
language_output_is("tcl",<<'TCL',<<OUT,"braces");
puts [llength [list a b {c {d e}}]]
TCL
3
OUT
language_output_is("tcl",<<'TCL',<<OUT,"spaces");
puts [llength [list a b "c {d e}"]]
TCL
3
OUT