Skip to content

Commit

Permalink
A few small improvements to the test suite:
Browse files Browse the repository at this point in the history
- Move unchanging styles for #progress to style sheet

- Forgot to update testCM() when I added the `verbose` option
  • Loading branch information
Brandon Frohs authored and marijnh committed Sep 7, 2012
1 parent cab9417 commit 5d3d207
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ function test(name, run, expectedFail) {
function testCM(name, run, opts, expectedFail) {
return test("core_" + name, function() {
var place = document.getElementById("testground"), cm = CodeMirror(place, opts);
var successful = false;
try {
run(cm);
successful = true;
} finally {
if (debug) {
if ((debug && !successful) || verbose) {
place.style.visibility = "";
} else {
place.removeChild(cm.getWrapperElement());
Expand Down
8 changes: 7 additions & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
.fail {color: #e00;}
.error {color: #c90;}
.done {font-weight: bold;}
#progress {
background: #45d;
color: white;
font-weight: bold;
white-space: pre;
}
</style>
</head>
<body>
Expand All @@ -23,7 +29,7 @@ <h1>CodeMirror: Test Suite</h1>
<p>A limited set of programmatic sanity tests for CodeMirror.</p>

<div style="border: 1px solid black; padding: 1px; max-width: 700px;">
<div style="background: #45d; white-space: pre; width: 0px; font-weight: bold; color: white;" id=progress><div style="padding: 3px;">Ran <span id="progress_ran">0</span><span id="progress_total"> of 0</span> tests</div></div>
<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>
</div>
<p id=status>Please enable JavaScript...</p>
<div id=output></div>
Expand Down

0 comments on commit 5d3d207

Please sign in to comment.