Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.isa(Obj,Str) doesn't work correctly if the Str contains colons. #1376

Closed
p6rt opened this issue Oct 24, 2009 · 8 comments
Closed

.isa(Obj,Str) doesn't work correctly if the Str contains colons. #1376

p6rt opened this issue Oct 24, 2009 · 8 comments

Comments

@p6rt
Copy link

p6rt commented Oct 24, 2009

Migrated from rt.perl.org#69999 (status was 'resolved')

Searchable as RT69999$

@p6rt
Copy link
Author

p6rt commented Oct 24, 2009

From adam.prime@utoronto.ca

The attached patch adds 4 more tests to 07-isa.t. test #​6 currently fails.

Adam

@p6rt
Copy link
Author

p6rt commented Oct 24, 2009

From adam.prime@utoronto.ca

isa.diff
diff --git a/t/01-sanity/07-isa.t b/t/01-sanity/07-isa.t
index 9fc9a2f..0b706ff 100644
--- a/t/01-sanity/07-isa.t
+++ b/t/01-sanity/07-isa.t
@@ -1,7 +1,7 @@
 use v6;
 
 
-say "1..3";
+say "1..7";
 
 {
     my $string = "Pugs";
@@ -17,3 +17,15 @@ say "1..3";
     my $code = { 42 };
     if $code.isa("Code")  { say "ok 3" } else { say "not ok 3" }
 }
+class Thing {};
+{
+    my $thing = Thing.new();
+    if $thing.isa("Thing")  { say "ok 4" } else { say "not ok 4" }
+    if $thing.isa(Thing)  { say "ok 5" } else { say "not ok 5" }
+}
+class Thing::something {};
+{
+    my $thing = Thing::something.new();
+    if $thing.isa("Thing::something")  { say "ok 6" } else { say "not ok 6" }
+    if $thing.isa(Thing::something)  { say "ok 7" } else { say "not ok 7" }
+}

@p6rt
Copy link
Author

p6rt commented Oct 24, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in at least one of these files​: AUTHORS, t/spec/S29-any/isa.t

commit 8000490d34a3e1073e29c05f57df81ebf06b4308
Author​: jsut <jsut@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Sat Oct 24 14​:53​:23 2009 +0000

  Tests for RT #​69999, .isa on classes with colons in their names
 
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28892 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/AUTHORS b/AUTHORS
index 9f3f4d8..44a2610 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -7,6 +7,7 @@ Aaron "ajs" Sherman              (ASHER)
 Aankhola Encorporated            (AANKHEN)
 Adam "alias" Kennedy             (ADAMK)
 Adam Preble
+Adam "jsut" Prime                (APRIME)
 Adrian "adehohum" Taylor
 Adriano Ferreira                 (FERREIRA)
 Adrian "Auzon" Kreher
diff --git a/t/spec/S29-any/isa.t b/t/spec/S29-any/isa.t
index 88a0361..7e21a0d 100644
--- a/t/spec/S29-any/isa.t
+++ b/t/spec/S29-any/isa.t
@@ -18,7 +18,7 @@ L<S29/Any/=item isa/>
 
 =end kwid 
 
-plan 11;
+plan 15;
 
 { # invocant notation  
     my @arr = <1 2 3 4>;
@@ -59,4 +59,17 @@ plan 11;
     ok(![1, 2, 3, 4].isa(Hash), '... [1, 2, 3, 4].isa("Hash") fail predicably');    
 }
 
+class Thing {};
+{
+    my $thing = Thing.new();
+    ok($thing.isa("Thing"));
+    ok($thing.isa(Thing));
+}
+class Thing::something {};
+{
+    my $thing = Thing::something.new();
+    ok($thing.isa("Thing::something"));
+    ok($thing.isa(Thing::something));
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Oct 24, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 12, 2010

From @bbkr

still broken on * build

[13​:39] <bbkr> rakudo​: use Test; class Thing​::something {}; my $thing =
Thing​::something.new(); ok($thing.isa("Thing​::something"));
ok($thing.isa(Thing​::something));
[13​:39] <p6eval> rakudo 9d7428​: OUTPUT«not ok 1 - ␤ok 2 - ␤»

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

NOM

bbkr​:nom bbkr$ ./perl6 -e 'use Test; class Thing​::something {}; my
$thing = Thing​::something.new(); ok($thing.isa("Thing​::something"));
ok($thing.isa(Thing​::something));'
ok 1 -
ok 2 -

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

From @bbkr

Those tests are now in S29-any/isa.t, unfudged and passing.

@p6rt
Copy link
Author

p6rt commented Sep 11, 2011

@bbkr - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Sep 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant