Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (40 sloc) 1.26 KB
# Copyright (C) 2009, Parrot Foundation.
=head1 NAME
test parrot to external Tcl connection
% prove t/library/tcl_lib.t
.const int TESTS = 1
.sub 'main' :main
load_bytecode 'Test/More.pbc'
.local pmc exports, curr_namespace, test_namespace
curr_namespace = get_namespace
test_namespace = get_namespace [ 'Test'; 'More' ]
exports = split ' ', 'plan diag ok nok is is_deeply like isa_ok skip isnt todo'
test_namespace.'export_to'(curr_namespace, exports)
load_bytecode 'TclLibrary.pbc' # TBD pbc
'ok'(1, 'loaded TclLibrary')
goto skip_all # this is TEMPORARY untill the case of missing libtcl is fixed
.local pmc tcl
tcl = new 'TclLibrary'
'ok'(1, 'created instance')
.local string res
.local int ires
res = tcl.'eval'("return {3+3}")
'is'(res, '3+3', 'return of a string')
# TODO res = tcl.'eval'("return [list a b foo bar]")
ires = tcl.'eval'("expr {3+3}")
'is'(ires, 6, 'return of an integer')
res = tcl.'eval'("return [expr 1.0]")
'is'(res, '1.0', 'return of double')
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
Something went wrong with that request. Please try again.