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

Use note() instead of diag() #164

Merged
merged 1 commit into from Dec 7, 2021

Conversation

jkeenan
Copy link
Contributor

@jkeenan jkeenan commented Dec 7, 2021

In the documentation for Test::More, the note() function is described as
"Handy for putting in notes which might be useful for debugging, but
don't indicate a problem." diag() is mainly intended to be used in
situations where a unit test has failed and more diagnostic output would
be helpful in debugging.

Here, we're simply making a note of the name of the tempfile created
during testing, so note() is more appropriate.

In addition, note() prints to STDOUT when the tests are run as part of a
harness; diag() prints to STDERR. When Encode's test suite is run as
part of the Perl 5 core distribution's test suite, this diag() statement
is the only statement that gets printed to STDERR. Once this p.r. is
applied, a new version of Encode is released to CPAN, and that version
is synched into blead, then Perl's test suite will run entirely to
STDOUT.

In the documentation for Test::More, the note() function is described as
"Handy for putting in notes which might be useful for debugging, but
don't indicate a problem."  diag() is mainly intended to be used in
situations where a unit test has failed and more diagnostic output would
be helpful in debugging.

Here, we're simply making a note of the name of the tempfile created
during testing, so note() is more appropriate.

In addition, note() prints to STDOUT when the tests are run as part of a
harness; diag() prints to STDERR.  When Encode's test suite is run as
part of the Perl 5 core distribution's test suite, this diag() statement
is the *only* statement that gets printed to STDERR.  Once this p.r. is
applied, a new version of Encode is released to CPAN, and that version
is synched into blead, then Perl's test suite will run entirely to
STDOUT.
@dankogai dankogai merged commit 275a06d into dankogai:master Dec 7, 2021
@dankogai
Copy link
Owner

dankogai commented Dec 7, 2021

Thank you!

kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Apr 25, 2022
Changelog:
==========
! bin/enc2xs t/enc_data.t t/enc_module.t t/encoding.t t/jperl.t
  Pulled: Fix Issue openembedded#144, spurious warnings from -Wc++-compate,
   and a few related nits
  dankogai/p5-encode#168
! MANIFEST
  add t/utf32warnings.t which was missing
! t/taint.t
  Pulled: Skip taint tests if your perl was built without taint support
  dankogai/p5-encode#167
! Unicode/Unicode.pm
  Pulled: fix link to Unicode standard
  dankogai/p5-encode#165
! t/Unicode_trailing_nul.t
  Pulled: Use note() instead of diag()
  dankogai/p5-encode#164

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
kraj pushed a commit to YoeDistro/meta-openembedded that referenced this pull request Apr 25, 2022
Changelog:
==========
! bin/enc2xs t/enc_data.t t/enc_module.t t/encoding.t t/jperl.t
  Pulled: Fix Issue openembedded#144, spurious warnings from -Wc++-compate,
   and a few related nits
  dankogai/p5-encode#168
! MANIFEST
  add t/utf32warnings.t which was missing
! t/taint.t
  Pulled: Skip taint tests if your perl was built without taint support
  dankogai/p5-encode#167
! Unicode/Unicode.pm
  Pulled: fix link to Unicode standard
  dankogai/p5-encode#165
! t/Unicode_trailing_nul.t
  Pulled: Use note() instead of diag()
  dankogai/p5-encode#164

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
halstead pushed a commit to openembedded/meta-openembedded that referenced this pull request May 3, 2022
Changelog:
==========
! bin/enc2xs t/enc_data.t t/enc_module.t t/encoding.t t/jperl.t
  Pulled: Fix Issue #144, spurious warnings from -Wc++-compate,
   and a few related nits
  dankogai/p5-encode#168
! MANIFEST
  add t/utf32warnings.t which was missing
! t/taint.t
  Pulled: Skip taint tests if your perl was built without taint support
  dankogai/p5-encode#167
! Unicode/Unicode.pm
  Pulled: fix link to Unicode standard
  dankogai/p5-encode#165
! t/Unicode_trailing_nul.t
  Pulled: Use note() instead of diag()
  dankogai/p5-encode#164

Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit a21bab9)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
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

Successfully merging this pull request may close these issues.

None yet

2 participants