Sha256: cab0526c5cd89df546a8094da78dd6aa976d72d923263e6c6976fc2388c5e7e9

Contents?: true

Size: 1.01 KB

Versions: 6

Compression:

Stored size: 1.01 KB

Contents

require "test_helper"

module Latexpdf
  class EscaperTest < MiniTest::Test
    def test_escape_ampersand
      assert_equal "\\&", Latexpdf.escape_latex("&")
    end

    def test_escape_dollar
      assert_equal "\\$", Latexpdf.escape_latex("$")
    end

    def test_escape_pound
      assert_equal "\\#", Latexpdf.escape_latex("#")
    end

    def test_escape_underscore
      assert_equal "\\_", Latexpdf.escape_latex("_")
    end

    def test_escape_lcurly
      assert_equal "\\{", Latexpdf.escape_latex("{")
    end

    def test_escape_rcurly
      assert_equal "\\}", Latexpdf.escape_latex("}")
    end

    def test_escape_tilde
      assert_equal "\\textasciitilde{}", Latexpdf.escape_latex("~")
    end

    def test_escape_ciicircum
      assert_equal "\\textasciicircum{}", Latexpdf.escape_latex("^")
    end

    def test_escape_backslash
      assert_equal "\\textbackslash{}", Latexpdf.escape_latex("\\")
    end

    def test_escape_percent_sign
      assert_equal "\\%", Latexpdf.escape_latex("%")
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
latexpdf-0.4.7 test/latexpdf/escaper_test.rb
latexpdf-0.4.6 test/latexpdf/escaper_test.rb
latexpdf-0.4.5 test/latexpdf/escaper_test.rb
latexpdf-0.4.4 test/latexpdf/escaper_test.rb
latexpdf-0.4.3 test/latexpdf/escaper_test.rb
latexpdf-0.4.2 test/latexpdf/escaper_test.rb