test.js 853 B

1234567891011121314151617
  1. // CodeMirror, copyright (c) by Marijn Haverbeke and others
  2. // Distributed under an MIT license: https://codemirror.net/LICENSE
  3. ;(function () {
  4. var mode = CodeMirror.getMode({ indentUnit: 2 }, 'ruby')
  5. function MT(name) {
  6. test.mode(name, mode, Array.prototype.slice.call(arguments, 1))
  7. }
  8. MT('divide_equal_operator', '[variable bar] [operator /=] [variable foo]')
  9. MT('divide_equal_operator_no_spacing', '[variable foo][operator /=][number 42]')
  10. MT('complex_regexp', '[keyword if] [variable cr] [operator =~] [string-2 /(?: \\( #{][tag RE_NOT][string-2 }\\( | #{][tag RE_NOT_PAR_OR][string-2 }* #{][tag RE_OPA_OR][string-2 } )/][variable x]')
  11. MT('indented_heredoc', '[keyword def] [def x]', ' [variable y] [operator =] [string <<-FOO]', '[string bar]', '[string FOO]', '[keyword end]')
  12. })()