summaryrefslogtreecommitdiff
path: root/ext/VMS-DCLsym/t/vms_dclsym.t
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2009-09-03 10:20:19 -0500
committerCraig A. Berry <craigberry@mac.com>2009-09-03 12:54:01 -0500
commit26dd53a231877708d84e7376aa20e4e8e561fe4e (patch)
tree126a0804e8f0cae4994aac9a2a4c4cdeab25ba31 /ext/VMS-DCLsym/t/vms_dclsym.t
parentb7d7e1dad734d27d791c1f48094cb4b84f6c6165 (diff)
downloadperl-26dd53a231877708d84e7376aa20e4e8e561fe4e.tar.gz
Move vms/ext/DCLsym and vms/ext/Stdio to ext/VMS-DCLsym and ext/VMS-Stdio.
Diffstat (limited to 'ext/VMS-DCLsym/t/vms_dclsym.t')
-rw-r--r--ext/VMS-DCLsym/t/vms_dclsym.t41
1 files changed, 41 insertions, 0 deletions
diff --git a/ext/VMS-DCLsym/t/vms_dclsym.t b/ext/VMS-DCLsym/t/vms_dclsym.t
new file mode 100644
index 0000000000..57f2afbd20
--- /dev/null
+++ b/ext/VMS-DCLsym/t/vms_dclsym.t
@@ -0,0 +1,41 @@
+print "1..15\n";
+
+require VMS::DCLsym or die "failed 1\n";
+print "ok 1\n";
+
+tie %syms, VMS::DCLsym or die "failed 2\n";
+print "ok 2\n";
+
+$name = 'FOO_'.time();
+$syms{$name} = 'Perl_test';
+print +($! ? "(\$! = $!) not " : ''),"ok 3\n";
+
+print +($syms{$name} eq 'Perl_test' ? '' : 'not '),"ok 4\n";
+
+($val) = `Show Symbol $name` =~ /(\w+)"$/;
+print +($val eq 'Perl_test' ? '' : 'not '),"ok 5\n";
+
+while (($sym,$val) = each %syms) {
+ last if $sym eq $name && $val eq 'Perl_test';
+}
+print +($sym ? '' : 'not '),"ok 6\n";
+
+delete $syms{$name};
+print +($! ? "(\$! = $!) not " : ''),"ok 7\n";
+
+print +(defined($syms{$name}) ? 'not ' : ''),"ok 8\n";
+undef %syms;
+
+$obj = new VMS::DCLsym 'GLOBAL';
+print +($obj ? '' : 'not '),"ok 9\n";
+
+print +($obj->clearcache(0) ? '' : 'not '),"ok 10\n";
+print +($obj->clearcache(1) ? 'not ' : ''),"ok 11\n";
+
+print +($obj->setsym($name,'Another_test') ? '' : 'not '),"ok 12\n";
+
+($val,$tab) = $obj->getsym($name);
+print +($val eq 'Another_test' && $tab eq 'GLOBAL' ? '' : 'not '),"ok 13\n";
+
+print +($obj->delsym($name,'LOCAL') ? 'not ' : ''),"ok 14\n";
+print +($obj->delsym($name,'GLOBAL') ? '' : 'not '),"ok 15\n";