Skip to content
This repository

Added a test #60

Merged
merged 1 commit into from over 1 year ago

2 participants

Pawel Murias Jonathan Worthington
Pawel Murias
Collaborator

No description provided.

Jonathan Worthington jnthn merged commit 51989fe into from
Jonathan Worthington jnthn closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 18, 2012
Pawel Murias pmurias Add a test for NQPClassHOW. 0e83ea3
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 20 additions and 0 deletions. Show diff stats Hide diff stats

  1. +20 0 t/nqp/65-how.t
20 t/nqp/65-how.t
... ... @@ -0,0 +1,20 @@
  1 +#!./parrot nqp.pbc
  2 +
  3 +# check subs
  4 +
  5 +plan(4);
  6 +
  7 +class Foo {
  8 + has $!foo_attr;
  9 +}
  10 +class Bar is Foo {
  11 + has $!bar_attr;
  12 +}
  13 +
  14 +my $foo := Foo.new();
  15 +my @Foo-attrs := $foo.HOW.attributes($foo,:local(1));
  16 +ok(@Foo-attrs[0].name eq '$!foo_attr',"we can get an attribute");
  17 +my $bar := Bar.new();
  18 +ok(+$bar.HOW.attributes($bar,:local(1)) == 1,"we only get local attributes");
  19 +ok(+$bar.HOW.attributes($bar,:local(0)) == 2,"we get all attributes");
  20 +ok($bar.HOW.attributes($bar) == 2,"we can skip :local");

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.