Sha256: 200c3e9e6b99f0e7b5f768850d28674a90c43a803fc4b2f1fcb660811cea6520
Contents?: true
Size: 731 Bytes
Versions: 28
Compression:
Stored size: 731 Bytes
Contents
require 'spec_helper' describe RubyXL::Text do describe '.to_s' do it 'should not crash processing UNICODE data' do bytes = [ 114, 39, 95, 120, 48, 48, 56, 48, 95, 226, 132, 162, 115, 32, 103, 105, 114, 108, 102, 114, 105, 101, 110, 100, 39, 95, 120, 48, 48, 56, 48, 95, 226, 132, 162, 115, 32, 104, 111] t = RubyXL::Text.new(:value => bytes.pack("c*").force_encoding('UTF-8')) str = t.to_s expect(str).to be end it 'should not escape valid XML extended UNICODE characters' do t = RubyXL::Text.new(:value => "\u{10000}\u{10FFFF}") xml = t.write_xml[/<t>[^<]+<\/t>/] expect(xml).to eq("<t>\u{10000}\u{10FFFF}</t>") end end end
Version data entries
28 entries across 28 versions & 2 rubygems