Permalink
Browse files

Refactored evalfile tests under t/spec/S29-context

git-svn-id: http://svn.pugscode.org/pugs@19558 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 614108e commit ce3256fbbb69ca77aa084faa6237e64d07a651cc cosimo committed Jan 17, 2008
Showing with 24 additions and 0 deletions.
  1. +24 −0 S29-context/evalfile.t
View
24 S29-context/evalfile.t
@@ -0,0 +1,24 @@
+use v6-alpha;
+use Test;
+
+plan 1;
+
+# L<S29/Context/"=item evalfile">
+
+sub nonce () { return (".$*PID." ~ int rand 1000) }
+
+if $*OS eq "browser" {
+ skip_rest "Programs running in browsers don't have access to regular IO.";
+ exit;
+}
+
+my $tmpfile = "temp-evalfile" ~ nonce();
+{
+ my $fh = open("$tmpfile", :w);
+ say $fh: "32 + 10";
+ close $fh;
+}
+
+is evalfile($tmpfile), 42, "evalfile() works";
+
+END { unlink $tmpfile }

0 comments on commit ce3256f

Please sign in to comment.