Skip to content

Commit db474ef

Browse files
committed
Add test for nqp::escape.
1 parent 93aea23 commit db474ef

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/nqp/59-nqpop.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Test nqp::op pseudo-functions.
44

5-
plan(111);
5+
plan(113);
66

77

88
ok( nqp::add_i(5,2) == 7, 'nqp::add_i');
@@ -95,6 +95,10 @@ ok( nqp::not_i(0) == 1, 'nqp::not_i');
9595
ok( nqp::not_i(1) == 0, 'nqp::not_i');
9696
ok( nqp::not_i(-1) == 0, 'nqp::not_i');
9797

98+
ok(nqp::escape("\b \n \r \f \t \" \\ \e foo") eq '\\b \\n \\r \\f \\t \\" \\\\ \e foo','nqp::escape');
99+
my $var := 'foo';
100+
ok(nqp::escape($var) eq 'foo','nqp::escape works with literal');
101+
98102
ok( nqp::isnull(nqp::null()) == 1, 'nqp::isnull/nqp::null' );
99103
ok( nqp::isnull("hello") == 0, '!nqp::isnull(string)' );
100104
ok( nqp::isnull(13232) == 0, 'nqp::isnull(number)' );

0 commit comments

Comments
 (0)