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
[PATCH] add descriptions for basic tests #16045
Comments
From vitali.peil@uni-bielefeld.deCreated by vitali.peil@uni-bielefeld.deFirst of all: this is my first perl patch. If it's appropriate I can add more of this in the future. If not, Perl Info
|
From vitali.peil@uni-bielefeld.de0001-add-test-descriptions-for-some-basic-tests.patchFrom 3fee568137415c16677c1c370f2f949540e66213 Mon Sep 17 00:00:00 2001
From: Vitali Peil <vitali.peil@uni-bielefeld.de>
Date: Fri, 23 Jun 2017 13:47:53 +0200
Subject: [PATCH] add test descriptions for some basic tests
---
AUTHORS | 1 +
t/base/cond.t | 16 ++++++++--------
t/base/if.t | 4 ++--
t/base/pat.t | 4 ++--
t/base/translate.t | 7 +++----
5 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 7fdb694..7b5d912 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1250,6 +1250,7 @@ Victor Efimov <victor@vsespb.ru>
Viktor Turskyi <koorchik@gmail.com>
Ville Skyttä <scop@cs132170.pp.htv.fi>
Vincent Pit <perl@profvince.com>
+Vitali Peil <vitali.peil@uni-bielefeld.de>
Vishal Bhatia <vishal@deja.com>
Vlad Harchev <hvv@hippo.ru>
Vladimir Alexiev <vladimir@cs.ualberta.ca>
diff --git a/t/base/cond.t b/t/base/cond.t
index e2ef358..0b41fe0 100644
--- a/t/base/cond.t
+++ b/t/base/cond.t
@@ -6,12 +6,12 @@ print "1..4\n";
$x = '0';
-$x eq $x && (print "ok 1\n");
-$x ne $x && (print "not ok 1\n");
-$x eq $x || (print "not ok 2\n");
-$x ne $x || (print "ok 2\n");
+$x eq $x && (print "ok 1 - operator eq\n");
+$x ne $x && (print "not ok 1 - operator ne\n");
+$x eq $x || (print "not ok 2 - operator eq\n");
+$x ne $x || (print "ok 2 - operator ne\n");
-$x == $x && (print "ok 3\n");
-$x != $x && (print "not ok 3\n");
-$x == $x || (print "not ok 4\n");
-$x != $x || (print "ok 4\n");
+$x == $x && (print "ok 3 - operator ==\n");
+$x != $x && (print "not ok 3 - operator !=\n");
+$x == $x || (print "not ok 4 - operator ==\n");
+$x != $x || (print "ok 4 - operator !=\n");
diff --git a/t/base/if.t b/t/base/if.t
index f093b0d..be86d4c 100644
--- a/t/base/if.t
+++ b/t/base/if.t
@@ -5,5 +5,5 @@ print "1..2\n";
# first test to see if we can run the tests.
$x = 'test';
-if ($x eq $x) { print "ok 1\n"; } else { print "not ok 1\n";}
-if ($x ne $x) { print "not ok 2\n"; } else { print "ok 2\n";}
+if ($x eq $x) { print "ok 1 - if eq\n"; } else { print "not ok 1 - if eq\n";}
+if ($x ne $x) { print "not ok 2 - if ne\n"; } else { print "ok 2 - if ne\n";}
diff --git a/t/base/pat.t b/t/base/pat.t
index 9e3f615..2d02fa0 100644
--- a/t/base/pat.t
+++ b/t/base/pat.t
@@ -5,5 +5,5 @@ print "1..2\n";
# first test to see if we can run the tests.
$_ = 'test';
-if (/^test/) { print "ok 1\n"; } else { print "not ok 1\n";}
-if (/^foo/) { print "not ok 2\n"; } else { print "ok 2\n";}
+if (/^test/) { print "ok 1 - match regex\n"; } else { print "not ok 1 - match regex\n";}
+if (/^foo/) { print "not ok 2 - match regex\n"; } else { print "ok 2 - match regex\n";}
diff --git a/t/base/translate.t b/t/base/translate.t
index 614f22c..a25ae8e 100644
--- a/t/base/translate.t
+++ b/t/base/translate.t
@@ -1,7 +1,7 @@
#!./perl
# Verify round trip of translations from the native character set to unicode
-# and back work. If this is wrong, nothing will be reliable.
+# and back work. If this is wrong, nothing will be reliable.
print "1..257\n"; # 0-255 plus one beyond
@@ -14,7 +14,7 @@ for my $i (0 .. 255) {
print "not ";
}
print "ok ";
- print $i + 1;
+ print $i + 1 . " - native_to_unicode $i";
print "\n";
}
@@ -23,5 +23,4 @@ for my $i (0 .. 255) {
if (utf8::unicode_to_native(utf8::native_to_unicode(100000)) != 100000) {
print "not ";
}
-print "ok ";
-print "257\n";
+print "ok 257 - native_to_unicode of large number\n";
--
2.1.4
|
From @jkeenanOn Mon, 26 Jun 2017 06:37:37 GMT, vitali.peil@uni-bielefeld.de wrote:
I'm attaching a patch which focuses on the tests for t/base/translate.t. Karl, since you wrote that test file, can you review it and apply it if it's okay? I'm not acting on the patches for the other three test files for reasons of history and sentiment rather than code. The three files in question are part of Larry Wall's very first commit to Perl in 1987. I am loathe to overwrite code for which 'git blame' still blames Larry. (See attachment.) If P5P wants to overrule me, I won't object -- but that requires a discussion. Vitali, thanks for your efforts. There are plenty of other tests which lack descriptions for you (and anyone) to tackle. Thank you very much. -- |
From @jkeenan$ git blame t/base/cond.t | head -20 |
The RT System itself - Status changed from 'new' to 'open' |
From vitali.peil@uni-bielefeld.deAm Mon, 26 Jun 2017 16:15:02 -0700, jkeenan schrieb:
Hi, I wasn't aware of the fact (Larry's first commit). So I will do some work on other test files... |
From @jkeenanOn Thu, 29 Jun 2017 10:42:00 GMT, vitali.peil@uni-bielefeld.de wrote:
We're still reviewing your patches for the 4th file, so the ticket is still open. -- |
From @iabynOn Mon, Jun 26, 2017 at 04:15:03PM -0700, James E Keenan via RT wrote:
I don't think sentimentality is a good reason not to apply patches which -- |
From @jkeenanOn Thu, 29 Jun 2017 10:42:00 GMT, vitali.peil@uni-bielefeld.de wrote:
Patches to one file applied in commit 8abe6e1. Thank you very much. -- |
From vitali.peil@uni-bielefeld.deAm 03.07.2017 um 09:45 schrieb Dave Mitchell via RT:
If we agree that sentimentality is no reason, I would submit more -- |
From @xsawyerxOn 10/04/2017 11:53 AM, Vitali Peil wrote:
One possibly higher goal here, which might deserve consideration, is From Porting/todo.pod: Migrate t/ from custom TAP generation Many tests below t/ still generate TAP by "hand", rather than using The subdirectories base, cmd, comp and opbasic, that contain the Would you fancy such work as part of your effort to improve our testing? |
Committer's note: I'm belatedly applying the rest of the patches from the original ticket.
I applied the remainder of this patch in 8a283e0 Thanks |
Migrated from rt.perl.org#131655 (status was 'open')
Searchable as RT131655$
The text was updated successfully, but these errors were encountered: