scss_test.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. (function() {
  2. var mode = CodeMirror.getMode({tabSize: 4}, "text/x-scss");
  3. function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); }
  4. MT('url_with_quotation',
  5. "[tag foo] { [property background][operator :][string-2 url]([string test.jpg]) }");
  6. MT('url_with_double_quotes',
  7. "[tag foo] { [property background][operator :][string-2 url]([string \"test.jpg\"]) }");
  8. MT('url_with_single_quotes',
  9. "[tag foo] { [property background][operator :][string-2 url]([string \'test.jpg\']) }");
  10. MT('string',
  11. "[def @import] [string \"compass/css3\"]");
  12. MT('important_keyword',
  13. "[tag foo] { [property background][operator :][string-2 url]([string \'test.jpg\']) [keyword !important] }");
  14. MT('variable',
  15. "[variable-2 $blue][operator :][atom #333]");
  16. MT('variable_as_attribute',
  17. "[tag foo] { [property color][operator :][variable-2 $blue] }");
  18. MT('numbers',
  19. "[tag foo] { [property padding][operator :][number 10px] [number 10] [number 10em] [number 8in] }");
  20. MT('number_percentage',
  21. "[tag foo] { [property width][operator :][number 80%] }");
  22. MT('selector',
  23. "[builtin #hello][qualifier .world]{}");
  24. MT('singleline_comment',
  25. "[comment // this is a comment]");
  26. MT('multiline_comment',
  27. "[comment /*foobar*/]");
  28. MT('attribute_with_hyphen',
  29. "[tag foo] { [property font-size][operator :][number 10px] }");
  30. MT('string_after_attribute',
  31. "[tag foo] { [property content][operator :][string \"::\"] }");
  32. MT('directives',
  33. "[def @include] [qualifier .mixin]");
  34. MT('basic_structure',
  35. "[tag p] { [property background][operator :][keyword red]; }");
  36. MT('nested_structure',
  37. "[tag p] { [tag a] { [property color][operator :][keyword red]; } }");
  38. MT('mixin',
  39. "[def @mixin] [tag table-base] {}");
  40. MT('number_without_semicolon',
  41. "[tag p] {[property width][operator :][number 12]}",
  42. "[tag a] {[property color][operator :][keyword red];}");
  43. MT('atom_in_nested_block',
  44. "[tag p] { [tag a] { [property color][operator :][atom #000]; } }");
  45. MT('interpolation_in_property',
  46. "[tag foo] { [operator #{][variable-2 $hello][operator }:][atom #000]; }");
  47. MT('interpolation_in_selector',
  48. "[tag foo][operator #{][variable-2 $hello][operator }] { [property color][operator :][atom #000]; }");
  49. MT('interpolation_error',
  50. "[tag foo][operator #{][error foo][operator }] { [property color][operator :][atom #000]; }");
  51. MT("divide_operator",
  52. "[tag foo] { [property width][operator :][number 4] [operator /] [number 2] }");
  53. MT('nested_structure_with_id_selector',
  54. "[tag p] { [builtin #hello] { [property color][operator :][keyword red]; } }");
  55. })();