test.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
  6. MT("unbalancedDoubledQuotedString",
  7. "[string \"a'b\"][variable c]");
  8. MT("unbalancedSingleQuotedString",
  9. "[string 'a\"b'][variable c]");
  10. MT("doubleQuotedString",
  11. "[string \"a\"][variable b]");
  12. MT("singleQuotedString",
  13. "[string 'a'][variable b]");
  14. MT("single attribute (with content)",
  15. "[node {][atom a:][string 'a'][node }]");
  16. MT("multiple attribute, singleQuotedString (with content)",
  17. "[node {][atom a:][string 'a'][node ,][atom b:][string 'b'][node }]");
  18. MT("multiple attribute, doubleQuotedString (with content)",
  19. "[node {][atom a:][string \"a\"][node ,][atom b:][string \"b\"][node }]");
  20. MT("single attribute (without content)",
  21. "[node {][atom a:][string 'a'][node }]");
  22. MT("multiple attribute, singleQuotedString (without content)",
  23. "[node {][atom a:][string ''][node ,][atom b:][string ''][node }]");
  24. MT("multiple attribute, doubleQuotedString (without content)",
  25. "[node {][atom a:][string \"\"][node ,][atom b:][string \"\"][node }]");
  26. })();