# we've not yet verified that use works.
# use strict;
-print "1..23\n";
+print "1..27\n";
my $test = 0;
# Historically constant folding was performed by evaluating the ops, and if
print " ", ++$test, " - print followed by const || URSINE\n";
BEGIN { $^W = 1 }
}
+
+# or stat
+print "not " unless stat(1 ? INSTALL : 0) eq stat("INSTALL");
+print "ok ", ++$test, " - stat(const ? word : ....)\n";
+# in case we are in t/
+print "not " unless stat(1 ? TEST : 0) eq stat("TEST");
+print "ok ", ++$test, " - stat(const ? word : ....)\n";
+
+# or truncate
+my $n = "for_fold_dot_t$$";
+open F, ">$n" or die "open: $!";
+print F "bralh blah blah \n";
+close F or die "close $!";
+eval "truncate 1 ? $n : 0, 0;";
+print "not " unless -z $n;
+print "ok ", ++$test, " - truncate(const ? word : ...)\n";
+unlink $n;
+
+# Constant folding should not change the mutability of returned values.
+for(1+2) {
+ eval { $_++ };
+ print "not " unless $_ eq 4;
+ print "ok ", ++$test,
+ " - 1+2 returns mutable value, just like \$a+\$b",
+ " # TODO\n";
+}