fix codetest failure - assert args
[parrot.git] / t / library / tcl_lib.t
blobd2f8ecb3e36fe6ae750bd66e994db263d4a12e47
1 #!./parrot
2 # Copyright (C) 2009, Parrot Foundation.
3 # $Id$
5 =head1 NAME
7 t/library/tcl_lib.t
9 =head1 DESCRIPTION
11 test parrot to external Tcl connection
13 =head1 SYNOPSIS
15     % prove t/library/tcl_lib.t
17 =cut
19 .const int TESTS = 1
21 .sub 'main' :main
22     load_bytecode 'Test/More.pbc'
24     .local pmc exports, curr_namespace, test_namespace
25     curr_namespace = get_namespace
26     test_namespace = get_namespace [ 'Test'; 'More' ]
27     exports        = split ' ', 'plan diag ok nok is is_deeply like isa_ok skip isnt todo'
29     test_namespace.'export_to'(curr_namespace, exports)
31     plan(TESTS)
33     load_bytecode 'TclLibrary.pbc' # TBD pbc
34     'ok'(1, 'loaded TclLibrary')
36     goto skip_all    # this is TEMPORARY untill the case of missing libtcl is fixed
38     .local pmc tcl
39     tcl = new 'TclLibrary'
40     'ok'(1, 'created instance')
42     .local string res
43     .local int ires
44     res = tcl.'eval'("return {3+3}")
45     'is'(res, '3+3', 'return of a string')
46     # TODO res = tcl.'eval'("return [list a b foo bar]")
47     ires = tcl.'eval'("expr {3+3}")
48     'is'(ires, 6, 'return of an integer')
49     res = tcl.'eval'("return [expr 1.0]")
50     'is'(res, '1.0', 'return of double')
52 skip_all:
54 .end
55 # Local Variables:
56 #   mode: pir
57 #   fill-column: 100
58 # End:
59 # vim: expandtab shiftwidth=4 ft=pir: