Sha256: 3bb46d417aeb536d61a59a2d8a56fa42eb392ecc84784af682a2d758c2568a4f

Contents?: true

Size: 1.27 KB

Versions: 4

Compression:

Stored size: 1.27 KB

Contents

# frozen_string_literal: true

require_relative './xlsx-func-testcase'

class TestEscapes < XlsxWriterTestCase
  test 'escapes03' do |wb|
    wb
      .add_format(:bold, bold: true)
      .add_format(:italic, italic: true)
      .add_worksheet
      .write_string('A1', 'Foo', :bold)
      .write_string('A2', 'Bar', :italic)
      .write_rich_string('A3', [['a'], ["b\"<>'c", :bold], ['defg']])

  end

  test 'escapes04' do |wb|
    wb.add_worksheet
      .write_url(0, 'A', 'http://www.perl.com/?a=1&b=2')
  end

  test 'escapes05' do |wb|
    wb.add_worksheet('Start')
      .write_url(0, 'A', 'internal:\'A & B\'!A1', string: 'Jump to A & B')
    wb.add_worksheet('A & B')
  end

  test 'escapes06' do |wb|
    ws = wb.add_worksheet
    ws.set_column(0, 0, width: 14)
    wb.add_format :f1, num_format: '[Red]0.0%\\ "a"'
    ws.write_number(0, 'A', 123, :f1)
  end

  test 'escapes07' do |wb|
    wb.add_worksheet
      .write_url(0, 'A', 'http://example.com/!"$%&\'( )*+,-./0123456789:;<=>?@' \
                         'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`'                    \
                         'abcdefghijklmnopqrstuvwxyz{|}~', nil)
  end

  test 'escapes08' do |wb|
    wb.add_worksheet
      .write_url 0, 'A', 'http://example.com/%5b0%5d', string: 'http://example.com/[0]'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xlsxwriter-0.2.1.pre.2 test/test-escapes.rb
xlsxwriter-0.2.1.pre test/test-escapes.rb
xlsxwriter-0.2.0 test/test-escapes.rb
xlsxwriter-0.2.0.pre.2 test/test-escapes.rb