class CompilerTest

Public Instance Methods

setup() click to toggle source
# File ../../../../../test/test_compiler.rb, line 9
def setup
  @builder = LATEXBuilder.new
  @c = Compiler.new(@builder)
end
test_parse_args() click to toggle source
# File ../../../../../test/test_compiler.rb, line 14
def test_parse_args
  args = @c.__send__(:parse_args, '[foo][bar]')
  assert_equal ['foo', 'bar'], args
end
test_parse_args_with_backslash() click to toggle source
# File ../../../../../test/test_compiler.rb, line 29
def test_parse_args_with_backslash
  args = @c.__send__(:parse_args, '[foo][bar\buz]')
  assert_equal ['foo', 'bar\buz'], args
end
test_parse_args_with_backslash2() click to toggle source
# File ../../../../../test/test_compiler.rb, line 34
def test_parse_args_with_backslash2
  args = @c.__send__(:parse_args, '[foo][bar\#\[\!]')
  assert_equal ['foo', 'bar\#\[\!'], args
end
test_parse_args_with_backslash3() click to toggle source
# File ../../../../../test/test_compiler.rb, line 39
def test_parse_args_with_backslash3
  args = @c.__send__(:parse_args, '[foo][bar\\buz]')
  assert_equal ['foo', 'bar\buz'], args
end
test_parse_args_with_brace1() click to toggle source
# File ../../../../../test/test_compiler.rb, line 19
def test_parse_args_with_brace1
  args = @c.__send__(:parse_args, '[fo[\][\]o][bar]')
  assert_equal ['fo[][]o', 'bar'], args
end
test_parse_args_with_brace2() click to toggle source
# File ../../../../../test/test_compiler.rb, line 24
def test_parse_args_with_brace2
  args = @c.__send__(:parse_args, '[f\]o\]o][bar]')
  assert_equal ['f]o]o', 'bar'], args
end
test_replace_fence() click to toggle source
# File ../../../../../test/test_compiler.rb, line 44
def test_replace_fence
  actual = @c.__send__(:replace_fence, '@<m>${}\}|$, @<m>|{}\}\$|, @<m>|\{\a\}|, @<tt>|}|, @<tt>|\|, @<tt>|\\|, @<tt>|\\\|')
  assert_equal '@<m>{{\}\\\}|}, @<m>{{\}\\\}\$}, @<m>{\{\a\\\}}, @<tt>{\}}, @<tt>{\\}, @<tt>{\\\\}, @<tt>{\\\\\\}', actual
end