summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2011-04-13 17:02:39 -0700
committerJan Dubois <jand@activestate.com>2011-04-13 17:03:45 -0700
commit6d51015587940c2032a6533d886163f69ca028f9 (patch)
tree7189b706bdcca169d0860646330ad594a1f7982a /t
parent088225fdf76aeaafa844cf1a058d5c11106522c4 (diff)
downloadperl-6d51015587940c2032a6533d886163f69ca028f9.tar.gz
[perl #88420] BOM support on Windows broken in 5.13.11
When Perl reads the script in text mode, then the tell() position on the script handle may include stripped carriage return characters. Therefore the file position after reading the first line of the script may be one larger than the length of the input buffer.
Diffstat (limited to 't')
-rw-r--r--t/io/bom.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/io/bom.t b/t/io/bom.t
new file mode 100644
index 0000000000..dd1be6541e
--- /dev/null
+++ b/t/io/bom.t
@@ -0,0 +1,14 @@
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+
+BEGIN { require "./test.pl"; }
+
+plan(tests => 1);
+
+# It is important that the script contains at least one newline character
+# that can be expanded to \r\n on DOSish systems.
+fresh_perl_is("\xEF\xBB\xBFprint 1;\nprint 2", "12", {}, "script starts with a BOM" );