This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #103492] Give lvalue cx to (s)printf args
[perl5.git] / t / io / print.t
index 321eb1e..00ee7fb 100644 (file)
@@ -10,7 +10,7 @@ BEGIN {
 
 use strict 'vars';
 
-print "1..21\n";
+print "1..23\n";
 
 my $foo = 'STDOUT';
 print $foo "ok 1\n";
@@ -66,3 +66,8 @@ if (!exists &Errno::EBADF) {
     map print(+()), ('')x68;
     print "ok 21\n";
 }
+
+# printf with %n
+my $n = "abc";
+printf "ok 22%n - not really a test; just printing\n", substr $n,1,1;
+print "not " x ($n ne "a5c") . "ok 23 - printf with %n (got $n)\n";