Skip to content
Browse files

make latin1 test encoding test

  • Loading branch information...
1 parent ddf996e commit 398b102b8a09f4f43732b0f47ba9fa0709b26926 @ronaldxs ronaldxs committed Aug 12, 2012
Showing with 23 additions and 17 deletions.
  1. +23 −0 t/get-w3-latin1-utf8.t
  2. +0 −17 t/get-w3-latin1.t
View
23 t/get-w3-latin1-utf8.t
@@ -0,0 +1,23 @@
+use v6;
+use Test;
+
+use LWP::Simple;
+
+my $html = LWP::Simple.get('http://www.w3.org/2006/11/mwbp-tests/test-encoding-8.html');
+
+my $find_char = Buf.new(0xE9).decode('iso-8859-1');
+ok(
+ $html.match('</html>') && $html.match($find_char),
+ 'Got latin-1 page'
+);
+
+$html = LWP::Simple.get('http://www.w3.org/2006/11/mwbp-tests/test-encoding-8.html');
+$find_char = Buf.new(0xC3, 0xA9).decode('utf-8');
+ok(
+ $html.match('</html>') && $html.match($find_char),
+ 'Got utf-8 page'
+);
+#diag("Content\n" ~ $html);
+
+done;
+
View
17 t/get-w3-latin1.t
@@ -1,17 +0,0 @@
-use v6;
-use Test;
-
-use LWP::Simple;
-
-my $html = LWP::Simple.get('http://www.w3.org/2006/11/mwbp-tests/test-encoding-8.html');
-
-my $find_char = Buf.new(0xE9).decode('latin-1');
-ok(
- $html.match('</html>') && $html.match($find_char),
- 'Got latin-1 page'
-);
-
-#diag("Content\n" ~ $html);
-
-done;
-

0 comments on commit 398b102

Please sign in to comment.
Something went wrong with that request. Please try again.