Path: blob/master/web-gui/buildyourownbotnet/assets/js/codemirror/mode/css/test.js
1294 views
(function() {1var mode = CodeMirror.getMode({indentUnit: 2}, "css");2function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }34// Error, because "foobarhello" is neither a known type or property, but5// property was expected (after "and"), and it should be in parenthese.6MT("atMediaUnknownType",7"[def @media] [attribute screen] [keyword and] [error foobarhello] { }");89// Soft error, because "foobarhello" is not a known property or type.10MT("atMediaUnknownProperty",11"[def @media] [attribute screen] [keyword and] ([error foobarhello]) { }");1213// Make sure nesting works with media queries14MT("atMediaMaxWidthNested",15"[def @media] [attribute screen] [keyword and] ([property max-width]: [number 25px]) { [tag foo] { } }");1617MT("tagSelector",18"[tag foo] { }");1920MT("classSelector",21"[qualifier .foo-bar_hello] { }");2223MT("idSelector",24"[builtin #foo] { [error #foo] }");2526MT("tagSelectorUnclosed",27"[tag foo] { [property margin]: [number 0] } [tag bar] { }");2829MT("tagStringNoQuotes",30"[tag foo] { [property font-family]: [variable hello] [variable world]; }");3132MT("tagStringDouble",33"[tag foo] { [property font-family]: [string \"hello world\"]; }");3435MT("tagStringSingle",36"[tag foo] { [property font-family]: [string 'hello world']; }");3738MT("tagColorKeyword",39"[tag foo] {",40" [property color]: [keyword black];",41" [property color]: [keyword navy];",42" [property color]: [keyword yellow];",43"}");4445MT("tagColorHex3",46"[tag foo] { [property background]: [atom #fff]; }");4748MT("tagColorHex6",49"[tag foo] { [property background]: [atom #ffffff]; }");5051MT("tagColorHex4",52"[tag foo] { [property background]: [atom&error #ffff]; }");5354MT("tagColorHexInvalid",55"[tag foo] { [property background]: [atom&error #ffg]; }");5657MT("tagNegativeNumber",58"[tag foo] { [property margin]: [number -5px]; }");5960MT("tagPositiveNumber",61"[tag foo] { [property padding]: [number 5px]; }");6263MT("tagVendor",64"[tag foo] { [meta -foo-][property box-sizing]: [meta -foo-][atom border-box]; }");6566MT("tagBogusProperty",67"[tag foo] { [property&error barhelloworld]: [number 0]; }");6869MT("tagTwoProperties",70"[tag foo] { [property margin]: [number 0]; [property padding]: [number 0]; }");7172MT("tagTwoPropertiesURL",73"[tag foo] { [property background]: [atom url]([string //example.com/foo.png]); [property padding]: [number 0]; }");7475MT("commentSGML",76"[comment <!--comment-->]");7778MT("commentSGML2",79"[comment <!--comment]",80"[comment -->] [tag div] {}");8182MT("indent_tagSelector",83"[tag strong], [tag em] {",84" [property background]: [atom rgba](",85" [number 255], [number 255], [number 0], [number .2]",86" );",87"}");8889MT("indent_atMedia",90"[def @media] {",91" [tag foo] {",92" [property color]:",93" [keyword yellow];",94" }",95"}");9697MT("indent_comma",98"[tag foo] {",99" [property font-family]: [variable verdana],",100" [atom sans-serif];",101"}");102103MT("indent_parentheses",104"[tag foo]:[variable-3 before] {",105" [property background]: [atom url](",106"[string blahblah]",107"[string etc]",108"[string ]) [keyword !important];",109"}");110111MT("font_face",112"[def @font-face] {",113" [property font-family]: [string 'myfont'];",114" [error nonsense]: [string 'abc'];",115" [property src]: [atom url]([string http://blah]),",116" [atom url]([string http://foo]);",117"}");118})();119120121