File modules/editor/codemirror/test/index.html

Last commit: Tue May 22 22:39:53 2018 +0200	Jan Dankert	Fix für PHP 7.2: 'Object' darf nun nicht mehr als Klassennamen verwendet werden. AUCH NICHT IN EINEM NAMESPACE! WTF, wozu habe ich das in einen verfickten Namespace gepackt? Wozu soll der sonst da sein??? Amateure. Daher nun notgedrungen unbenannt in 'BaseObject'.
1 <!doctype html> 2 3 <meta charset="utf-8"/> 4 <title>CodeMirror: Test Suite</title> 5 <link rel=stylesheet href="../doc/docs.css"> 6 7 <link rel="stylesheet" href="../lib/codemirror.css"> 8 <link rel="stylesheet" href="mode_test.css"> 9 <script src="../doc/activebookmark.js"></script> 10 <script src="../lib/codemirror.js"></script> 11 <script src="../mode/meta.js"></script> 12 <script src="../addon/mode/overlay.js"></script> 13 <script src="../addon/mode/multiplex.js"></script> 14 <script src="../addon/search/searchcursor.js"></script> 15 <script src="../addon/dialog/dialog.js"></script> 16 <script src="../addon/edit/matchbrackets.js"></script> 17 <script src="../addon/hint/sql-hint.js"></script> 18 <script src="../addon/comment/comment.js"></script> 19 <script src="../addon/mode/simple.js"></script> 20 <script src="../mode/css/css.js"></script> 21 <script src="../mode/clike/clike.js"></script> 22 <!-- clike must be after css or vim and sublime tests will fail --> 23 <script src="../mode/cypher/cypher.js"></script> 24 <script src="../mode/d/d.js"></script> 25 <script src="../mode/gfm/gfm.js"></script> 26 <script src="../mode/haml/haml.js"></script> 27 <script src="../mode/htmlmixed/htmlmixed.js"></script> 28 <script src="../mode/javascript/javascript.js"></script> 29 <script src="../mode/jsx/jsx.js"></script> 30 <script src="../mode/markdown/markdown.js"></script> 31 <script src="../mode/php/php.js"></script> 32 <script src="../mode/python/python.js"></script> 33 <script src="../mode/powershell/powershell.js"></script> 34 <script src="../mode/ruby/ruby.js"></script> 35 <script src="../mode/sass/sass.js"></script> 36 <script src="../mode/shell/shell.js"></script> 37 <script src="../mode/slim/slim.js"></script> 38 <script src="../mode/soy/soy.js"></script> 39 <script src="../mode/sql/sql.js"></script> 40 <script src="../mode/stex/stex.js"></script> 41 <script src="../mode/swift/swift.js"></script> 42 <script src="../mode/textile/textile.js"></script> 43 <script src="../mode/verilog/verilog.js"></script> 44 <script src="../mode/xml/xml.js"></script> 45 <script src="../mode/xquery/xquery.js"></script> 46 <script src="../keymap/emacs.js"></script> 47 <script src="../keymap/sublime.js"></script> 48 <script src="../keymap/vim.js"></script> 49 <script src="../mode/rust/rust.js"></script> 50 <script src="../mode/mscgen/mscgen.js"></script> 51 <script src="../mode/dylan/dylan.js"></script> 52 53 <style type="text/css"> 54 .ok {color: #090;} 55 .fail {color: #e00;} 56 .error {color: #c90;} 57 .done {font-weight: bold;} 58 #progress { 59 background: #45d; 60 color: white; 61 text-shadow: 0 0 1px #45d, 0 0 2px #45d, 0 0 3px #45d; 62 font-weight: bold; 63 white-space: pre; 64 } 65 #testground { 66 visibility: hidden; 67 } 68 #testground.offscreen { 69 visibility: visible; 70 position: absolute; 71 left: -10000px; 72 top: -10000px; 73 } 74 .CodeMirror { border: 1px solid black; } 75 </style> 76 77 <div id=nav> 78 <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a> 79 80 <ul> 81 <li><a href="../index.html">Home</a> 82 <li><a href="../doc/manual.html">Manual</a> 83 <li><a href="https://github.com/codemirror/codemirror">Code</a> 84 </ul> 85 <ul> 86 <li><a class=active href="#">Test suite</a> 87 </ul> 88 </div> 89 90 <article> 91 <h2>Test Suite</h2> 92 93 <p>A limited set of programmatic sanity tests for CodeMirror.</p> 94 95 <div style="border: 1px solid black; padding: 1px; max-width: 700px;"> 96 <div style="width: 0px;" id=progress><div style="padding: 3px;">Ran <span id="progress_ran">0</span><span id="progress_total"> of 0</span> tests</div></div> 97 </div> 98 <p id=status>Please enable JavaScript...</p> 99 <div id=output></div> 100 101 <div id=testground></div> 102 103 <script src="driver.js"></script> 104 <script src="test.js"></script> 105 <script src="doc_test.js"></script> 106 <script src="multi_test.js"></script> 107 <script src="contenteditable_test.js"></script> 108 <script src="scroll_test.js"></script> 109 <script src="comment_test.js"></script> 110 <script src="search_test.js"></script> 111 <script src="mode_test.js"></script> 112 113 <script src="../mode/clike/test.js"></script> 114 <script src="../mode/css/test.js"></script> 115 <script src="../mode/css/gss_test.js"></script> 116 <script src="../mode/css/scss_test.js"></script> 117 <script src="../mode/css/less_test.js"></script> 118 <script src="../mode/cypher/test.js"></script> 119 <script src="../mode/d/test.js"></script> 120 <script src="../mode/gfm/test.js"></script> 121 <script src="../mode/haml/test.js"></script> 122 <script src="../mode/javascript/test.js"></script> 123 <script src="../mode/jsx/test.js"></script> 124 <script src="../mode/markdown/test.js"></script> 125 <script src="../mode/php/test.js"></script> 126 <script src="../mode/powershell/test.js"></script> 127 <script src="../mode/ruby/test.js"></script> 128 <script src="../mode/sass/test.js"></script> 129 <script src="../mode/shell/test.js"></script> 130 <script src="../mode/slim/test.js"></script> 131 <script src="../mode/soy/test.js"></script> 132 <script src="../mode/stex/test.js"></script> 133 <script src="../mode/swift/test.js"></script> 134 <script src="../mode/textile/test.js"></script> 135 <script src="../mode/verilog/test.js"></script> 136 <script src="../mode/xml/test.js"></script> 137 <script src="../mode/xquery/test.js"></script> 138 <script src="../mode/python/test.js"></script> 139 <script src="../mode/rust/test.js"></script> 140 <script src="../mode/mscgen/mscgen_test.js"></script> 141 <script src="../mode/mscgen/xu_test.js"></script> 142 <script src="../mode/mscgen/msgenny_test.js"></script> 143 <script src="../mode/dylan/test.js"></script> 144 <script src="../addon/mode/multiplex_test.js"></script> 145 <script src="emacs_test.js"></script> 146 <script src="sql-hint-test.js"></script> 147 <script src="sublime_test.js"></script> 148 <script src="vim_test.js"></script> 149 <script> 150 window.onload = runHarness; 151 CodeMirror.on(window, 'hashchange', runHarness); 152 153 function esc(str) { 154 return str.replace(/[<&]/, function(ch) { return ch == "<" ? "&lt;" : "&amp;"; }); 155 } 156 157 var output = document.getElementById("output"), 158 progress = document.getElementById("progress"), 159 progressRan = document.getElementById("progress_ran").childNodes[0], 160 progressTotal = document.getElementById("progress_total").childNodes[0]; 161 var count = 0, 162 failed = 0, 163 skipped = 0, 164 bad = "", 165 running = false, // Flag that states tests are running 166 quit = false, // Flag to quit tests ASAP 167 verbose = false; // Adds message for *every* test to output 168 169 function runHarness(){ 170 if (running) { 171 quit = true; 172 setStatus("Restarting tests...", '', true); 173 setTimeout(function(){runHarness();}, 500); 174 return; 175 } 176 filters = []; 177 verbose = false; 178 if (window.location.hash.substr(1)){ 179 var strings = window.location.hash.substr(1).split(","); 180 while (strings.length) { 181 var s = strings.shift(); 182 if (s === "verbose") 183 verbose = true; 184 else 185 filters.push(parseTestFilter(decodeURIComponent(s))); 186 } 187 } 188 quit = false; 189 running = true; 190 setStatus("Loading tests..."); 191 count = 0; 192 failed = 0; 193 skipped = 0; 194 bad = ""; 195 totalTests = countTests(); 196 progressTotal.nodeValue = " of " + totalTests; 197 progressRan.nodeValue = count; 198 output.innerHTML = ''; 199 document.getElementById("testground").innerHTML = "<form>" + 200 "<textarea id=\"code\" name=\"code\"></textarea>" + 201 "<input type=submit value=ok name=submit>" + 202 "</form>"; 203 runTests(displayTest); 204 } 205 206 function setStatus(message, className, force){ 207 if (quit && !force) return; 208 if (!message) throw("must provide message"); 209 var status = document.getElementById("status").childNodes[0]; 210 status.nodeValue = message; 211 status.parentNode.className = className; 212 } 213 function addOutput(name, className, code){ 214 var newOutput = document.createElement("dl"); 215 var newTitle = document.createElement("dt"); 216 newTitle.className = className; 217 newTitle.appendChild(document.createTextNode(name)); 218 newOutput.appendChild(newTitle); 219 var newMessage = document.createElement("dd"); 220 newMessage.innerHTML = code; 221 newOutput.appendChild(newTitle); 222 newOutput.appendChild(newMessage); 223 output.appendChild(newOutput); 224 } 225 function displayTest(type, name, customMessage) { 226 var message = "???"; 227 if (type != "done" && type != "skipped") ++count; 228 progress.style.width = (count * (progress.parentNode.clientWidth - 2) / (totalTests || 1)) + "px"; 229 progressRan.nodeValue = count; 230 if (type == "ok") { 231 message = "Test '" + name + "' passed"; 232 if (!verbose) customMessage = false; 233 } else if (type == "skipped") { 234 message = "Test '" + name + "' skipped"; 235 ++skipped; 236 if (!verbose) customMessage = false; 237 } else if (type == "expected") { 238 message = "Test '" + name + "' failed as expected"; 239 if (!verbose) customMessage = false; 240 } else if (type == "error" || type == "fail") { 241 ++failed; 242 message = "Test '" + name + "' failed"; 243 } else if (type == "done") { 244 if (failed) { 245 type += " fail"; 246 message = failed + " failure" + (failed > 1 ? "s" : ""); 247 } else if (count < totalTests) { 248 failed = totalTests - count; 249 type += " fail"; 250 message = failed + " failure" + (failed > 1 ? "s" : ""); 251 } else { 252 type += " ok"; 253 message = "All passed"; 254 if (skipped) { 255 message += " (" + skipped + " skipped)"; 256 } 257 } 258 progressTotal.nodeValue = ''; 259 customMessage = true; // Hack to avoid adding to output 260 } 261 if (verbose && !customMessage) customMessage = message; 262 setStatus(message, type); 263 if (customMessage && customMessage.length > 0) { 264 addOutput(name, type, customMessage); 265 } 266 } 267 </script> 268 269 </article>
Download modules/editor/codemirror/test/index.html
History Tue, 22 May 2018 22:39:53 +0200 Jan Dankert Fix für PHP 7.2: 'Object' darf nun nicht mehr als Klassennamen verwendet werden. AUCH NICHT IN EINEM NAMESPACE! WTF, wozu habe ich das in einen verfickten Namespace gepackt? Wozu soll der sonst da sein??? Amateure. Daher nun notgedrungen unbenannt in 'BaseObject'.