X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=examples%2Ftest.ml;h=05d60423d9594e0df413a4e39d622a3c2c64f70d;hb=5575ed1d8c00267716604b82392b184e6e983739;hp=56d2bfa48b1f3636b5404d3b81ddcdca9871c282;hpb=dafc0bde0b51d76c41b2d646af3699730e31dfbb;p=perl4caml.git diff --git a/examples/test.ml b/examples/test.ml index 56d2bfa..05d6042 100644 --- a/examples/test.ml +++ b/examples/test.ml @@ -1,16 +1,16 @@ (* Simple test of the API. * Copyright (C) 2003 Merjis Ltd. - * $Id: test.ml,v 1.1 2003-10-12 11:56:27 rich Exp $ + * $Id: test.ml,v 1.6 2003-12-11 17:41:52 rich Exp $ *) open Printf let () = - (* Arguments passed to the Perl "command line". Loads [test.pl] *) - let args = [| ""; "-wT"; "examples/test.pl" |] in + (* Perform a full collection - good way to find bugs in initialization code*) + Gc.full_major (); - (* Create the Perl interpreter. *) - let pl = Perl.create ~args () in + (* Load "test.pl". *) + Perl.eval "require 'examples/test.pl'"; (* Call some subroutines in [test.pl]. *) let sv = Perl.call ~fn:"return_one" [] in @@ -48,5 +48,5 @@ let () = let sv = Perl.call_method obj "get_foo" [] in printf "TestClass.foo is %d\n" (Perl.int_of_sv sv); flush stdout; - (* Destroy the interpreter. *) - Perl.destroy pl + (* Perform a full collection - good way to find GC/allocation bugs. *) + Gc.full_major ()