Skip to content

Commit 7914bf6

Browse files
committed
Test calling nqp::elems on hashes.
1 parent 0198475 commit 7914bf6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

t/nqp/18-associative.t

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

33
# check hash access methods
44

5-
plan(14);
5+
plan(15);
66

77
my %h;
88

@@ -35,5 +35,7 @@ my $h := nqp::hash('foo', 123,'bar','hello');
3535
ok($h<foo> == 123, 'hash access on a hash created with nqp::hash');
3636
ok($h<bar> eq 'hello', 'hash access on a hash created with nqp::hash');
3737

38+
ok(nqp::elems($h) == 2, 'nqp::elems on a hash');
39+
3840
ok(nqp::istrue(nqp::hash('foo', 1, 'bar', 2)) == 1, 'a hash with 2 elements is true');
3941
ok(nqp::istrue(nqp::hash()) == 0, 'a hash with 0 elements is false');

0 commit comments

Comments
 (0)