Skip to content

Commit

Permalink
move underscore test into a div
Browse files Browse the repository at this point in the history
more comfortable to include underscore with tests in some other project.
  • Loading branch information
chaoflow committed Jun 25, 2011
1 parent 0202f9f commit 9ab3ac4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion test/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $(document).ready(function() {
var doubled = _([1, 2, 3]).map(function(num){ return num * 2; });
equals(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers');

var ids = _.map(document.body.childNodes, function(n){ return n.id; });
var ids = _.map($('div.underscore-test').children(), function(n){ return n.id; });
ok(_.include(ids, 'qunit-header'), 'can use collection methods on NodeLists');

var ids = _.map(document.images, function(n){ return n.id; });
Expand Down
35 changes: 18 additions & 17 deletions test/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,27 @@
<script type="text/javascript" src="speed.js"></script>
</head>
<body>
<h1 id="qunit-header">Underscore Test Suite</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<br />
<h1 class="qunit-header">Underscore Speed Suite</h1>
<p>
A representative sample of the functions are benchmarked here, to provide
a sense of how fast they might run in different browsers.
Each iteration runs on an array of 1000 elements.<br /><br />
For example, the 'intersect' test measures the number of times you can
find the intersection of two thousand-element arrays in one second.
</p>
<br />
<div class="underscore-test">
<h1 id="qunit-header">Underscore Test Suite</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<br />
<h1 class="qunit-header">Underscore Speed Suite</h1>
<p>
A representative sample of the functions are benchmarked here, to provide
a sense of how fast they might run in different browsers.
Each iteration runs on an array of 1000 elements.<br /><br />
For example, the 'intersect' test measures the number of times you can
find the intersection of two thousand-element arrays in one second.
</p>
<br />

<script type="text/html" id="template">
<script type="text/html" id="template">
<%
if (data) { data += 12345; }; %>
<li><%= data %></li>
</script>

</script>
</div>
</body>
</html>

0 comments on commit 9ab3ac4

Please sign in to comment.