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
Make basic Perl 6 tests pass #366
Comments
From @jkeenanI don't often build Rakudo, so I'm not even sure whether this is the make && make test t/00-parrot/06-op-inplace (Wstat: 0 Tests: 11 Failed: 0) Thank you very much. |
From @jkeenanOn Sun Oct 05 16:53:10 2008, jkeen@verizon.net wrote:
FWIW, the error was reproduced when I typed: make perl6 && make test |
@jkeenan - Status changed from 'new' to 'open' |
From @jkeenanHope this additional diagnostic info helps: $ perl t/harness --verbosity=1 t/00-parrot/06-op-inplace.t Test Summary Report t/00-parrot/06-op-inplace (Wstat: 0 Tests: 11 Failed: 0) |
From @jkeenanTonight I got this: t/00-parrot/06-op-inplace.......... All 11 subtests passed ... but then I subsequently got this: Test Summary Report t/00-parrot/06-op-inplace (Wstat: 0 Tests: 11 Failed: 0) I've never seen a test report like this, i.e., one which reports when kid51 |
From publiustemp-perl6internals2@yahoo.comIf you do this after building parrot: cd languages/perl6 This basic test suite will fail. That's because of this test program: t/00-parrot/06-op-inplace.t It was written before modules could be loaded and manually printed out "ok $num" lines, but it did so out of sequence. This causes Test::Harness to note a parse error and report a failure for the test suite, even though all tests pass. I've updated it to "use Test" and output test numbers in sequence without altering the semantics of the test. "make test" in languages/perl6 now passes on my MacBook. Cheers, |
From publiustemp-perl6internals2@yahoo.comperl6tests.patchIndex: languages/perl6/t/00-parrot/06-op-inplace.t
===================================================================
--- languages/perl6/t/00-parrot/06-op-inplace.t (revision 32047)
+++ languages/perl6/t/00-parrot/06-op-inplace.t (working copy)
@@ -4,52 +4,48 @@
use v6;
-say '1..11';
+use Test;
+plan 11;
my $a = 0;
$a += 1;
-print 'ok ';
-say $a;
+is $a, 1, '$var += Int';
+
++$a;
-print 'ok ';
-say $a;
+is $a, 2, '++$var';
+
$a = 4;
$a -= 1;
-print 'ok ';
-say $a;
+is $a, 3, '$var -= Int';
+
my $b = 1;
$a += $b;
-print 'ok ';
-say $a;
-# 5
+is $a, 4, '$var += $var2';
$a +|= $b;
-print 'ok ';
-say $a;
+is $a, 5, '$var +|= Int';
+
$a +&= +^$b;
$a +^= 2;
-print 'ok ';
-say $a;
+is $a, 6, '$var +&= +^$var2; $var +^= Int';
+
$a++;
-print 'ok ';
-say $a;
+is $a, 7, '$var++';
+
$a = 1;
$a +<= 3;
-print 'ok ';
-say $a;
+is $a, 8, '$var +<= Int';
#9
$a +>= 1;
$a -= 1;
$a **= 2;
-print 'ok ';
-say $a;
+is $a, 3, '$var +>= Int; $var -= Int; $var **= Int';
+#1 2 3 4 5 6 7 8 3 8 12
$a /= 3;
$a += 7;
-print 'ok ';
-say $a;
+is $a, 8, '$var /= Int; $var += Int';
$a %= 3;
-print 'ok ';
-say $a + 10;
+is $a + 10, 12, '$var %= Int; $var + Int';
|
From publiustemp-perl6internals2@yahoo.comOK, I've updated the patch. I've made the following assumptions: 1. I cannot load modules. The problem is that I've made the tests pass by assuming that the value of $a at each point is the correct value. I'm assuming from what Jerry has pointed out that these number should be sequential. It's a trivial fix to remedy this in the tests, but I didn't want to try and second-guess what was going on. I think this patch (or something similar) is important as those who want to play with Rakudo will see a test failure if they run 'make test' as the README instructs. Cheers, |
From publiustemp-perl6internals2@yahoo.comperl6tests.patchIndex: languages/perl6/t/00-parrot/06-op-inplace.t
===================================================================
--- languages/perl6/t/00-parrot/06-op-inplace.t (revision 32047)
+++ languages/perl6/t/00-parrot/06-op-inplace.t (working copy)
@@ -6,50 +6,69 @@
say '1..11';
+my $test_num = 1;
my $a = 0;
$a += 1;
-print 'ok ';
-say $a;
+print 'not ' if $a != 1;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
++$a;
-print 'ok ';
-say $a;
+print 'not ' if $a != 2;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
$a = 4;
$a -= 1;
-print 'ok ';
-say $a;
+
+print 'not ' if $a != 3;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
+
+
my $b = 1;
$a += $b;
-print 'ok ';
-say $a;
-# 5
+print 'not ' if $a != 4;
+say "ok $test_num";
+$test_num = $test_num + 1;
$a +|= $b;
-print 'ok ';
-say $a;
+print 'not ' if $a != 5;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
$a +&= +^$b;
$a +^= 2;
-print 'ok ';
-say $a;
+print 'not ' if $a != 6;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
$a++;
-print 'ok ';
-say $a;
+print 'not ' if $a != 7;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
$a = 1;
$a +<= 3;
-print 'ok ';
-say $a;
+print 'not ' if $a != 8;
+say "ok $test_num";
+$test_num = $test_num + 1;
-#9
$a +>= 1;
$a -= 1;
$a **= 2;
-print 'ok ';
-say $a;
+print 'not ' if $a != 3;
+say "ok $test_num";
+$test_num = $test_num + 1;
$a /= 3;
$a += 7;
-print 'ok ';
-say $a;
+print 'not ' if $a != 8;
+say "ok $test_num";
+$test_num = $test_num + 1;
$a %= 3;
-print 'ok ';
-say $a + 10;
+print 'not ' if ( $a +10 ) != 12;
+say "ok $test_num";
+$test_num = $test_num + 1;
|
From publiustemp-perl6internals2@yahoo.comSorry for the patch spam. I'm embarrassed that I didn't have this correct the first time (hey, YOU stay home and write tests for a strange platform while sick) The test will now fail, but they'll fail for the correct reason: **= is being misparsed, as pointed out earlier. You might not notice the tests failing, but that's because "make test" seems to run the harness 3 times and the failing test is in the first run. If you don't notice this, you won't notice these tests failing. Cheers, |
From publiustemp-perl6internals2@yahoo.comperl6tests.patchIndex: languages/perl6/t/00-parrot/06-op-inplace.t
===================================================================
--- languages/perl6/t/00-parrot/06-op-inplace.t (revision 32047)
+++ languages/perl6/t/00-parrot/06-op-inplace.t (working copy)
@@ -6,50 +6,70 @@
say '1..11';
+my $test_num = 1;
my $a = 0;
$a += 1;
-print 'ok ';
-say $a;
+print 'not ' if $a != 1;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
++$a;
-print 'ok ';
-say $a;
+print 'not ' if $a != 2;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
$a = 4;
$a -= 1;
-print 'ok ';
-say $a;
+
+print 'not ' if $a != 3;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
+
+
my $b = 1;
$a += $b;
-print 'ok ';
-say $a;
-# 5
+print 'not ' if $a != 4;
+say "ok $test_num";
+$test_num = $test_num + 1;
$a +|= $b;
-print 'ok ';
-say $a;
+print 'not ' if $a != 5;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
$a +&= +^$b;
$a +^= 2;
-print 'ok ';
-say $a;
+print 'not ' if $a != 6;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
$a++;
-print 'ok ';
-say $a;
+print 'not ' if $a != 7;
+say "ok $test_num";
+$test_num = $test_num + 1;
+
$a = 1;
$a +<= 3;
-print 'ok ';
-say $a;
+print 'not ' if $a != 8;
+say "ok $test_num";
+$test_num = $test_num + 1;
-#9
$a +>= 1;
$a -= 1;
$a **= 2;
-print 'ok ';
-say $a;
+print 'not ' if $a != 9;
+say "ok $test_num";
+$test_num = $test_num + 1;
+$a = 9;
$a /= 3;
$a += 7;
-print 'ok ';
-say $a;
+print 'not ' if $a != 10;
+say "ok $test_num";
+$test_num = $test_num + 1;
$a %= 3;
-print 'ok ';
-say $a + 10;
+print 'not ' if ( $a +10 ) != 11;
+say "ok $test_num";
+$test_num = $test_num + 1;
|
From @jkeenanOn Mon Oct 20 09:46:08 2008, publiustemp-perl6internals2@yahoo.com wrote:
I've reported this a couple of times in Since you're proposing a patch, I'll merge 59634 into this one. kid51 |
The RT System itself - Status changed from 'new' to 'open' |
From publiustemp-perl6internals2@yahoo.com--- On Tue, 21/10/08, James Keenan via RT <perl6-bugs-followup@perl.org>
Thanks. Hopefully this time there will be some traction because there does appear to be a bug in Perl 6, as evidenced by this one-liner: perl6 $ ../../parrot perl6.pbc -e 'my $x = 3; $x **= 2; say $x' Unless, of course, this isn't supposed to be implemented yet, but that seems strange since it's in the basic tests. Cheers, |
From @pmichaudOn Tue, Oct 21, 2008 at 12:21:24AM -0700, Ovid wrote:
The infix:<**=> code broke as part of the mmd branch merge, because a = a ** b # pow a, a, b Before the MMD merge, this opcode meant "raise a to the power I've corrected this in r32071, by explicitly assigning the new I've also applied Ovid's patch (with some fixes) in r32072, so Lastly, we've now reorganized the 'make test' target to make it more Thanks, closing ticket! Pm |
@pmichaud - Status changed from 'open' to 'resolved' |
From @allisonPatrick R. Michaud wrote:
The other math opcodes have two argument versions that call the 'i_' Allison |
From @pmichaudOn Thu, Oct 23, 2008 at 08:14:19PM -0700, Allison Randal via RT wrote:
I'm not sure that every opcode needs an inplace form. And in Rakudo's Thanks, Pm |
Migrated from rt.perl.org#60016 (status was 'resolved')
Searchable as RT60016$
The text was updated successfully, but these errors were encountered: