Permalink
Browse files

Add U::String#dup tests

  • Loading branch information...
1 parent af1aa28 commit 53050ef39a10528487cf1af5805fb4b0da7b9825 Nikolai Weibull committed Apr 3, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 test/unit/u/string.rb
View
@@ -9,6 +9,13 @@
expect 'äbc' do U::String.new('äbc'.encode(Encoding::ISO8859_1)).to_str end
expect Encoding::UndefinedConversionError do U::String.new('äbc'.encode(Encoding::ASCII_8BIT)) end
end
+ expect result.tainted? do 'u'.taint.u end
+ expect result.untrusted? do 'u'.untrust.u end
+
+ expect ''.u do ''.u.dup end
+ expect false do a = ''.u; a.dup.object_id == a.object_id end
+ expect result.tainted? do 'u'.u.taint.dup end
+ expect result.untrusted? do 'u'.u.untrust.dup end
expect true do 'äbc'.u.valid_encoding? end
expect true do "äbc\0def".u.valid_encoding? end

0 comments on commit 53050ef

Please sign in to comment.