[svn:parrot] r47404 - trunk/t/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Sat Jun 5 23:20:06 UTC 2010
Author: bacek
Date: Sat Jun 5 23:20:05 2010
New Revision: 47404
URL: https://trac.parrot.org/parrot/changeset/47404
Log:
Remove few redundant tests
Modified:
trunk/t/pmc/filehandle.t
trunk/t/pmc/io.t
Modified: trunk/t/pmc/filehandle.t
==============================================================================
--- trunk/t/pmc/filehandle.t Sat Jun 5 23:03:50 2010 (r47403)
+++ trunk/t/pmc/filehandle.t Sat Jun 5 23:20:05 2010 (r47404)
@@ -453,26 +453,46 @@
\$P1.'open'('$temp_file')
- \$S1 = \$P1.'readline'()
- if \$S1 == "1234567890\\n" goto ok_1
-print \$S1
+ .local string line
+ line = \$P1.'readline'()
+ if line == "1234567890\\n" goto ok_1
+print line
print 'not '
ok_1:
say 'ok 1 - \$S1 = \$P1.readline() # read with utf8 encoding on'
- \$S2 = \$P1.'readline'()
- if \$S2 == \$S0 goto ok_2
-print \$S2
+ line = \$P1.'readline'()
+ if line == \$S0 goto ok_2
+print line
print 'not '
ok_2:
say 'ok 2 - \$S2 = \$P1.readline() # read iso-8859-1 string'
\$P1.'close'()
+ \$I1 = charset line
+ \$S2 = charsetname \$I1
+ if \$S2 == 'unicode' goto ok_3
+ print \$S2
+ print 'not '
+ ok_3:
+ say 'ok 3 # unicode charset'
+
+
+ \$I1 = encoding line
+ \$S2 = encodingname \$I1
+ if \$S2 == 'utf8' goto ok_4
+ print \$S2
+ print 'not '
+ ok_4:
+ say 'ok 4 # utf8 encoding'
+
.end
CODE
ok 1 - $S1 = $P1.readline() # read with utf8 encoding on
ok 2 - $S2 = $P1.readline() # read iso-8859-1 string
+ok 3 # unicode charset
+ok 4 # utf8 encoding
OUT
Modified: trunk/t/pmc/io.t
==============================================================================
--- trunk/t/pmc/io.t Sat Jun 5 23:03:50 2010 (r47403)
+++ trunk/t/pmc/io.t Sat Jun 5 23:20:05 2010 (r47404)
@@ -7,7 +7,7 @@
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 45;
+use Parrot::Test tests => 43;
use Parrot::Test::Util 'create_tempfile';
use Parrot::Test::Util 'create_tempfile';
@@ -814,65 +814,6 @@
print $FOO "T\xc3\xb6tsch\n";
close $FOO;
-pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read enabled" );
-.loadlib 'io_ops'
-.sub main :main
- .local pmc pio
- .local int len
- .include "stat.pasm"
- .local string f
- f = '$temp_file'
- len = stat f, .STAT_FILESIZE
- pio = open f, 'r'
- pio.'encoding'("utf8")
- \$S0 = read pio, len
- close pio
- \$I1 = charset \$S0
- \$S2 = charsetname \$I1
- say \$S2
-
- \$I1 = encoding \$S0
- \$S2 = encodingname \$I1
- say \$S2
-
- \$I1 = find_charset 'iso-8859-1'
- trans_charset \$S1, \$S0, \$I1
- print \$S1
-.end
-CODE
-unicode
-utf8
-T\xf6tsch
-OUTPUT
-
-pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read enabled - readline" );
-.sub main :main
- .local pmc pio
- .local string f
- f = '$temp_file'
- pio = new ['FileHandle']
- pio.'open'(f, 'r')
- pio.'encoding'("utf8")
- \$S0 = pio.'readline'()
- pio.'close'()
- \$I1 = charset \$S0
- \$S2 = charsetname \$I1
- say \$S2
-
- \$I1 = encoding \$S0
- \$S2 = encodingname \$I1
- say \$S2
-
- \$I1 = find_charset 'iso-8859-1'
- trans_charset \$S1, \$S0, \$I1
- print \$S1
-.end
-CODE
-unicode
-utf8
-T\xf6tsch
-OUTPUT
-
pir_output_is( <<"CODE", <<"OUTPUT", "utf8 read enabled, read parts" );
.loadlib 'io_ops'
.sub main :main
More information about the parrot-commits
mailing list