Skip to content

Commit

Permalink
Add Print and Pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Sep 6, 2011
1 parent 1d81cf6 commit 7624510
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/TestML/Library/Standard.pm
Expand Up @@ -4,6 +4,7 @@ use TestML;
sub Point {
my $context = shift;
my $name = shift;
$name = $name->value if ref $name;
my $value = $context->runtime->function->getvar('Block')->points->{$name};
if ($value =~ s/\n+\z/\n/ and $value eq "\n") {
$value = '';
Expand Down Expand Up @@ -146,6 +147,16 @@ sub Read {
return str($text);
}

sub Print {
my $context = shift;
my $arg = shift;
print STDOUT $arg ? $arg->value : $context->value;
}

sub Pass {
return @_;
}

1;

# sub Context {
Expand Down Expand Up @@ -212,6 +223,3 @@ sub Read {
# return $context->runtime->block->points->{$point};
# }
#
# sub Select {
# return (shift)->value;
# }

0 comments on commit 7624510

Please sign in to comment.