2 var mode = CodeMirror.getMode({tabSize: 4}, "haml");
3 function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
5 // Requires at least one media query
7 "[tag %h1] Hey There");
9 MT("oneElementPerLine",
10 "[tag %h1] Hey There %h2");
13 "[tag %h1][attribute #test] Hey There");
16 "[tag %h1][attribute .hello] Hey There");
22 "[comment / Hello WORLD]");
25 "[tag %h1] This is not a / comment ");
28 "[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}");
31 "[tag <h1>]Title[tag </h1>]");
34 "[operator =][variable-2 @item]");
36 MT("selectorRubyBlock",
37 "[tag %a.selector=] [variable-2 @item]");
41 " [operator =][variable puts] [string \"test\"]");
43 MT("multilinePlaintext",
50 " [comment -# this is a comment]",
51 " [comment and this is a comment too]",
53 " [operator -] [variable now] [operator =] [tag DateTime][operator .][variable now]",
54 " [tag %strong=] [variable now]",
55 " [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][variable parse]([string \"December 31, 2006\"])",
56 " [operator =][string \"Happy\"]",
57 " [operator =][string \"Belated\"]",
58 " [operator =][string \"Birthday\"]");
60 MT("multilineComment",
62 " [comment Multiline]",
63 " [comment Comment]");
66 "[comment -# this is a comment]");
68 MT("multilineHamlComment",
69 "[comment -# this is a comment]",
70 " [comment and this is a comment too]");
72 MT("multilineHTMLComment",
74 " [comment what a comment]",
77 MT("hamlAfterRubyTag",
79 " [tag %strong=] [variable now]",
81 " [operator =][variable now]",
82 " [attribute .right]");
85 "[operator =] [variable puts] [string \"Hello\"],",
86 " [string \"World\"]");
88 MT("interpolationInHashAttribute",
89 //"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test");
90 "[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test");
92 MT("interpolationInHTMLAttribute",
93 "[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test");