Skip to content

Conversation

@hannaeko
Copy link
Contributor

Purpose

Fix unit test on Ubuntu 22.04.

Context

The po-files.t test fails on Ubuntu 22.04 with message

Can't use global $_ in "my" at t/po-files.t line 46, near ", $_ "
Execution of t/po-files.t aborted due to compilation errors.

Changes

  • Give a name to the variable.

How to test this PR

Running the test on Ubuntu 22.04 should succeed.

@hannaeko hannaeko added the T-Bug Type: Bug in software or error in test case description label May 24, 2023
@hannaeko hannaeko added this to the v2023.1 milestone May 24, 2023
@hannaeko hannaeko requested review from a user, marc-vanderwal, matsduf, mattias-p and tgreenx May 24, 2023 14:28
ghost
ghost previously approved these changes May 24, 2023
tgreenx
tgreenx previously approved these changes May 25, 2023
t/po-files.t Outdated

subtest "check msg args" => sub {
my ( $output, $_ ) = make "check-msg-args";
my ( $output, $status ) = make "check-msg-args";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $status is not used, then I think the following will work as well without defining something not used and that can confuse:

my ( $output ) = make "check-msg-args";

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@matsduf matsduf added the V-Patch Versioning: The change gives an update of patch in version. label May 25, 2023
@matsduf
Copy link
Contributor

matsduf commented May 26, 2023

Will this resolve the CI problem in #1234? The error says

    #   Failed test 'all files are tidied (if not run "make tidy-po")'
    #   at t/po-files.t line 63.
    #          got: '0	4	share/es.po
    # '
    #     expected: ''
    # Looks like you failed 1 test of 3.

#   Failed test 'tidy po files'
#   at t/po-files.t line 65.
# Looks like you failed 1 test of 4.
t/po-files.t .............. 

"tidy po files" is SKIPP'ed:

    50	subtest "tidy po files" => sub {
    51	    SKIP: {
    52	        my ( $output, $status );
    53	
    54	        $output = `git diff --numstat`;
    55	
    56	        skip 'git repo should be clean to run this test', 3 if $output ne '';
    57	
    58	        ( $output, $status ) = make "tidy-po";
    59	        is $status, 0,  $makebin . ' tidy-po exits with value 0';
    60	        is $output, "", $makebin . ' tidy-po gives empty output';
    61	
    62	        $output = `git diff --numstat`;
    63	        is $output, "", 'all files are tidied (if not run "make tidy-po")';
    64	    }
    65	};

@matsduf
Copy link
Contributor

matsduf commented May 29, 2023

The issue in #1234 was a different issue.

@hannaeko hannaeko dismissed stale reviews from tgreenx and ghost via 33aa6b3 May 30, 2023 09:23
@hannaeko hannaeko merged commit e904027 into zonemaster:develop May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Bug Type: Bug in software or error in test case description V-Patch Versioning: The change gives an update of patch in version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants