test.js 1.3 KB

1234567891011121314151617181920212223242526272829
  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({ tabSize: 4, indentUnit: 2 }, 'cypher')
  5. function MT(name) {
  6. test.mode(name, mode, Array.prototype.slice.call(arguments, 1))
  7. }
  8. MT('unbalancedDoubledQuotedString', '[string "a\'b"][variable c]')
  9. MT('unbalancedSingleQuotedString', "[string 'a\"b'][variable c]")
  10. MT('doubleQuotedString', '[string "a"][variable b]')
  11. MT('singleQuotedString', "[string 'a'][variable b]")
  12. MT('single attribute (with content)', "[node {][atom a:][string 'a'][node }]")
  13. MT('multiple attribute, singleQuotedString (with content)', "[node {][atom a:][string 'a'][node ,][atom b:][string 'b'][node }]")
  14. MT('multiple attribute, doubleQuotedString (with content)', '[node {][atom a:][string "a"][node ,][atom b:][string "b"][node }]')
  15. MT('single attribute (without content)', "[node {][atom a:][string 'a'][node }]")
  16. MT('multiple attribute, singleQuotedString (without content)', "[node {][atom a:][string ''][node ,][atom b:][string ''][node }]")
  17. MT('multiple attribute, doubleQuotedString (without content)', '[node {][atom a:][string ""][node ,][atom b:][string ""][node }]')
  18. })()