SHELL BYPASS 403 |
Modern UI. Responsive. Powerful.

Faizzz-Chin Shell

: /usr/share/doc/perl-Test-Simple-0.98/t/ [ drwxr-xr-x ]
Uname\Kernel: Linux server.kxo.bgz.mybluehostin.me 3.10.0-1160.119.1.el7.tuxcare.els19.x86_64 #1 SMP Mon Mar 31 17:29:00 UTC 2025 x86_64
Server: Apache
PHP Version: 8.2.28 [ PHP INFO ]
Operating System: Linux
Server Ip: 162.240.163.222
Your Ip: 216.73.216.114
Date Time: 2025-07-11 08:18:19
User: dilseshaadi (1027) | Group: dilseshaadi (1027)
Safe Mode: OFF
Disable Function: exec,passthru,shell_exec,system

name : diag.t
#!perl -w

BEGIN {
    if( $ENV{PERL_CORE} ) {
        chdir 't';
        @INC = ('../lib', 'lib');
    }
    else {
        unshift @INC, 't/lib';
    }
}


# Turn on threads here, if available, since this test tends to find
# lots of threading bugs.
use Config;
BEGIN {
    if( $] >= 5.008001 && $Config{useithreads} ) {
        require threads;
        'threads'->import;
    }
}


use strict;

use Test::Builder::NoOutput;
use Test::More tests => 7;

my $test = Test::Builder::NoOutput->create;

# Test diag() goes to todo_output() in a todo test.
{
    $test->todo_start();

    $test->diag("a single line");
    is( $test->read('todo'), <<'DIAG',   'diag() with todo_output set' );
# a single line
DIAG

    my $ret = $test->diag("multiple\n", "lines");
    is( $test->read('todo'), <<'DIAG',   '  multi line' );
# multiple
# lines
DIAG
    ok( !$ret, 'diag returns false' );

    $test->todo_end();
}


# Test diagnostic formatting
{
    $test->diag("# foo");
    is( $test->read('err'), "# # foo\n", "diag() adds # even if there's one already" );

    $test->diag("foo\n\nbar");
    is( $test->read('err'), <<'DIAG', "  blank lines get escaped" );
# foo
# 
# bar
DIAG

    $test->diag("foo\n\nbar\n\n");
    is( $test->read('err'), <<'DIAG', "  even at the end" );
# foo
# 
# bar
# 
DIAG
}


# [rt.cpan.org 8392] diag(@list) emulates print
{
    $test->diag(qw(one two));

    is( $test->read('err'), <<'DIAG' );
# onetwo
DIAG
}
© 2025 Faizzz-Chin