File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 6363 end
6464 end
6565
66+ it 'should always return unfrozen Strings' do
67+ TEST_CASES . each_pair do |input , encoded |
68+ assert_equal false , Ascii85 . encode ( input ) . frozen?
69+ end
70+ end
71+
6672 it 'should encode Strings in different encodings correctly' do
6773 input_euc_jp = 'どうもありがとうミスターロボット' . encode ( 'EUC-JP' )
6874 input_binary = input_euc_jp . force_encoding ( 'ASCII-8BIT' )
143149 end
144150 end
145151
152+ it 'should always return unfrozen Strings' do
153+ TEST_CASES . each_pair do |input , encoded |
154+ assert_equal false , Ascii85 . decode ( encoded ) . frozen?
155+ end
156+ end
157+
146158 it 'should accept valid input in encodings other than the default' do
147159 input = 'Ragnarök τέχνη русский язык I ♥ Ruby'
148160 input_ascii85 = Ascii85 . encode ( input )
221233 end
222234 end
223235
236+ it 'should always return unfrozen Strings' do
237+ TEST_CASES . each_pair do |decoded , input |
238+ raw_input = input [ 2 ...-2 ] # Remove '<~' and '~>'
239+ assert_equal false , Ascii85 . decode_raw ( raw_input ) . frozen?
240+ end
241+ end
242+
224243 it 'should decode from an IO object' do
225244 input = StringIO . new ( ';KZGo' )
226245 result = Ascii85 . decode_raw ( input )
You can’t perform that action at this time.
0 commit comments