void () { addTest("h$", "<h0></h0>"); addTest("h$.item$", "<h0 class=\"item0\"></h0>"); addTest("h$.item$*3", "<h1 class=\"item1\"></h1><h2 class=\"item2\"></h2><h3 class=\"item3\"></h3>"); addTest("h$.item${text $$$}*3", "<h1 class=\"item1\">text 001</h1><h2 class=\"item2\">text 002</h2><h3 class=\"item3\">text 003</h3>"); addTest("h$*3>b$", "<h1><b1></b1></h1><h2><b2></b2></h2><h3><b3></b3></h3>"); addTest("ul#nav>li.item$*3", "<ul id=\"nav\"><li class=\"item1\"></li><li class=\"item2\"></li><li class=\"item3\"></li></ul>"); addTest("ul#nav>li.item$$$*3", "<ul id=\"nav\"><li class=\"item001\"></li><li class=\"item002\"></li><li class=\"item003\"></li></ul>"); addTest("ul#nav>li.$$item$$$*3", "<ul id=\"nav\"><li class=\"01item001\"></li><li class=\"02item002\"></li><li class=\"03item003\"></li></ul>"); addTest("ul#nav>li.pre$*3+li.post$*3", "<ul id=\"nav\"><li class=\"pre1\"></li><li class=\"pre2\"></li><li class=\"pre3\"></li><li class=\"post1\"></li><li class=\"post2\"></li><li class=\"post3\"></li></ul>"); addTest(".sample$*3", "<div class=\"sample1\"></div><div class=\"sample2\"></div><div class=\"sample3\"></div>"); addTest("ul#nav>li{text}*3", "<ul id=\"nav\"><li>text</li><li>text</li><li>text</li></ul>"); addTest("p{Max Length Error: {{myForm.sample.$error.maxlength}}}", "<p>Max Length Error: {{myForm.sample.0error.maxlength}}</p>"); addTest("p{Max Length Error: {{myForm.sample.\\$error.maxlength}}}", "<p>Max Length Error: {{myForm.sample.$error.maxlength}}</p>"); addTest("p{Max Length Error: {{myForm.sample.\\\\$error.maxlength}}}", "<p>Max Length Error: {{myForm.sample.\\0error.maxlength}}</p>"); // counter base addTest("{$@3 }*3", "3 4 5 "); addTest("{$@- }*3", "3 2 1 "); addTest("{$@-5 }*3", "7 6 5 "); addTest("{$$@-5 }*3", "07 06 05 "); // numbering from groups addTest("(span.i$)*3", "<span class=\"i1\"></span><span class=\"i2\"></span><span class=\"i3\"></span>"); addTest("p.p$*2>(i.i$+b.b$)*3", "<p class=\"p1\"><i class=\"i1\"></i><b class=\"b1\"></b><i class=\"i2\"></i><b class=\"b2\"></b><i class=\"i3\"></i><b class=\"b3\"></b></p><p class=\"p2\"><i class=\"i1\"></i><b class=\"b1\"></b><i class=\"i2\"></i><b class=\"b2\"></b><i class=\"i3\"></i><b class=\"b3\"></b></p>"); addTest("(p.i$+ul>li.i$*2>span.s$)*3", "<p class=\"i1\"></p><ul><li class=\"i1\"><span class=\"s1\"></span></li><li class=\"i2\"><span class=\"s2\"></span></li></ul><p class=\"i2\"></p><ul><li class=\"i1\"><span class=\"s1\"></span></li><li class=\"i2\"><span class=\"s2\"></span></li></ul><p class=\"i3\"></p><ul><li class=\"i1\"><span class=\"s1\"></span></li><li class=\"i2\"><span class=\"s2\"></span></li></ul>"); // skip repeater replace addTest("span[class=item\\$]*2", "<span class=\"item$\"></span><span class=\"item$\"></span>"); addTest("span{item \\$}*2", "<span>item $</span><span>item $</span>"); // add offset to numbering addTest("span.item$@3*2", "<span class=\"item3\"></span><span class=\"item4\"></span>"); addTest("span.item$$@3*2", "<span class=\"item03\"></span><span class=\"item04\"></span>"); addTest("span.item$@*2", "<span class=\"item1\"></span><span class=\"item2\"></span>"); // numbering in descending order addTest("span.item$@-*2", "<span class=\"item2\"></span><span class=\"item1\"></span>"); addTest("span.item$@-3*2", "<span class=\"item4\"></span><span class=\"item3\"></span>"); addTest("span.item$@-9*2", "<span class=\"item10\"></span><span class=\"item9\"></span>"); addTest("span.item$$@-9*2", "<span class=\"item10\"></span><span class=\"item09\"></span>"); addTest("span$.item$@-*2", "<span1 class=\"item2\"></span1><span2 class=\"item1\"></span2>"); }