HEX
Server: Apache
System: Linux server-634962.emtiyz.com 5.14.0-611.11.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Dec 3 09:47:37 EST 2025 x86_64
User: codo66ho (1003)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/.cpan/build/Template-Toolkit-3.102-0/t/mtime-zero.t
#============================================================= -*-perl-*-
#
# t/mtime-zero.t
#
# Test template process with . in INCLUDE_PATH
#
# Written by Nicolas R. <atoomic@cpan.org>
#
# Copyright (C) 2018 cPanel Inc.  All Rights Reserved.
#
# This is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
# $Id$
#
#========================================================================

use strict;
use warnings;

use Template;

use File::Temp qw(tempfile tempdir);

use Test::More tests => 4;

my $content = "hello, world\n";

my ( $tmpfh, $tmpfile ) = tempfile( UNLINK => 1 );
print $tmpfh $content;
close $tmpfh or die $!;

{
    my $out;
    ok( Template->new( { ABSOLUTE => 1 } )->process( $tmpfile, {}, \$out ), "process tmpfile" );
    is( $out, $content, "content as expected" );
}

{
    utime 0, 0, $tmpfile or die $!;

    my $out;
    ok( Template->new( { ABSOLUTE => 1 } )->process( $tmpfile, {}, \$out ), "process tmpfile [utime=0]" );
    is( $out, $content, "content as expected [utime=0]" );
}