Skip to content
Browse files

Provide dummy loadlib "os" for backwards compat

  • Loading branch information...
1 parent 9eaa77a commit d76bef83f04f62f3e5871a6695526eb600b0d7a2 @rurban rurban committed
Showing with 40 additions and 3 deletions.
  1. +1 −0 MANIFEST
  2. +25 −0 src/dynpmc/os.pmc
  3. +14 −3 t/pmc/os.t
View
1 MANIFEST
@@ -1207,6 +1207,7 @@ src/dynpmc/foo.pmc []
src/dynpmc/foo2.pmc []
src/dynpmc/gziphandle.pmc []
src/dynpmc/main.pasm []
+src/dynpmc/os.pmc []
src/dynpmc/pccmethod_test.pmc []
src/dynpmc/rational.pmc []
src/dynpmc/rotest.pmc []
View
25 src/dynpmc/os.pmc
@@ -0,0 +1,25 @@
+/*
+Copyright (C) 2001-2012, Parrot Foundation.
+
+=head1 NAME
+
+src/dynpmc/os.pmc - Dummy dynpmc placeholder
+
+=head1 DESCRIPTION
+
+This pmc does nothing, OS is now a builtin.
+
+For backwards compatiblity with existing C<loadlib 'os'> calls.
+
+=cut
+
+*/
+
+pmclass OS pmc {}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4 cinoptions='\:2=2' :
+ */
View
17 t/pmc/os.t
@@ -5,7 +5,7 @@ use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 34;
+use Parrot::Test tests => 35;
use Parrot::Config;
use Cwd;
use File::Spec;
@@ -782,9 +782,20 @@ $xa
$xb
OUT
-unlink "test_f_a", "test_f_b", "test_f_c";
-
+# Support loadlib 'os' for a while
+pir_output_is( <<'CODE', <<"OUT", "loadlib 'os' deprecation" );
+.sub main :main
+ $P0 = loadlib 'os'
+ $P1 = new 'OS'
+ $S1 = $P1."cwd"()
+ print "ok\n"
+ end
+.end
+CODE
+ok
+OUT
+unlink "test_f_a", "test_f_b", "test_f_c";
# Local Variables:
# mode: cperl

0 comments on commit d76bef8

Please sign in to comment.
Something went wrong with that request. Please try again.