Skip to content
Browse files

Move some NTriples unicode specs to 1.9 only.

  • Loading branch information...
1 parent 0f293b8 commit 55758ced5df5fa123e8a75507983f3b6bf0ae868 @gkellogg gkellogg committed
Showing with 15 additions and 4 deletions.
  1. +15 −4 spec/ntriples_spec.rb
View
19 spec/ntriples_spec.rb
@@ -164,15 +164,26 @@
end
end
- context "unescape Unicode strings" do
+ context "unescape Unicode strings", :ruby => 1.9 do
+ strings = {
+ "\u677E\u672C \u540E\u5B50" => "松本 后子",
+ "D\u00FCrst" => "Dürst",
+ "\\U00015678another" => "\u{15678}another",
+ }
+ strings.each do |string, unescaped|
+ specify string do
+ unescaped = unescaped.dup.force_encoding(Encoding::UTF_8) if unescaped.respond_to?(:force_encoding)
+ @reader.unescape(string.dup).should == unescaped
+ end
+ end
+ end
+
+ context "unescape escaped Unicode strings" do
strings = {
"_\\u221E_" => "_\xE2\x88\x9E_", # U+221E, infinity symbol
"_\\u6C34_" => "_\xE6\xB0\xB4_", # U+6C34, 'water' in Chinese
- "\u677E\u672C \u540E\u5B50" => "松本 后子",
"\\u677E\\u672C \\u540E\\u5B50" => "松本 后子",
- "D\u00FCrst" => "Dürst",
"D\\u00FCrst" => "Dürst",
- "\\U00015678another" => "\u{15678}another",
}
strings.each do |string, unescaped|
specify string do

0 comments on commit 55758ce

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