Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tests that previously failed before the index -> stack length fix

  • Loading branch information...
commit 2890f1059428f8ca800c0e8b16177825c5a901bb 1 parent e496399
@substack authored
Showing with 104 additions and 0 deletions.
  1. +85 −0 test/article.html
  2. +19 −0 test/article.js
View
85 test/article.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html><html>
+<head>
+<meta charset="utf-8">
+<title>
+Echo JS - JavaScript News
+</title>
+<meta name="robots" content="index">
+<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+<link type="text/css" href="/css/style.css?v=10" rel="stylesheet">
+<link href="/favicon.ico" rel="shortcut icon">
+<script src="/js/jquery.1.6.4.min.js"></script><script src="/js/app.js?v=10"></script>
+</head>
+<body>
+<div class="container">
+<header><h1><a href="/">Echo JS</a> <small>0.11.0</small></h1><nav><a href="/">top</a>
+<a href="/latest/0">latest</a>
+<a href="/random">random</a>
+<a href="/submit">submit</a></nav> <nav id="account"><a href="/login">login / register</a></nav> <a href="#" id="link-menu-mobile"><~></a></header><div id="content">
+<div id="sitenews">
+Site News : Check out <a href="http://www.telize.com">Telize</a>, a JSON IP and GeoIP REST API (IP Geolocation)
+</div>
+<h2>Top news</h2><section id="newslist"><article data-news-id="5989"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="https://github.com/chilts/flake" rel="nofollow">Flake : generate practically unique approximately sortable IDs in a distributed environment</a></h2> <address>at github.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">2</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 6 hours ago <a href="/news/5989">discuss</a></p></article>
+<article data-news-id="5988"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://code.hootsuite.com/functional-testing-with-casperjs/" rel="nofollow">Functional testing with CasperJS</a></h2> <address>at code.hootsuite.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">2</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 6 hours ago <a href="/news/5988">discuss</a></p></article>
+<article data-news-id="5987"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://azu.github.io/Meta-Weekly/" rel="nofollow">Meta Weekly - A collection of weekly JS newsletters and websites</a></h2> <address>at azu.github.io</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/efcl">efcl</a></username> 14 hours ago <a href="/news/5987">discuss</a></p></article>
+<article data-news-id="5986"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://parall.ax/products/jspdf" rel="nofollow">jsPDF - HTML5 PDF Generator</a></h2> <address>at parall.ax</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/efcl">efcl</a></username> 14 hours ago <a href="/news/5986">discuss</a></p></article>
+<article data-news-id="5985"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://www.thinkful.com/learn/javascript-best-practices-1/" rel="nofollow">Javascript Best Practices Part 1</a></h2> <address>at www.thinkful.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/efcl">efcl</a></username> 14 hours ago <a href="/news/5985">discuss</a></p></article>
+<article data-news-id="5984"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://syntaxspectrum.com/2013/08/angularjs-highlights-week-ending-25-august-2013/" rel="nofollow">AngularJS Highlights: Week Ending 25 August 2013</a></h2> <address>at syntaxspectrum.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/aneesha">aneesha</a></username> 15 hours ago <a href="/news/5984">discuss</a></p></article>
+<article data-news-id="5983"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://ruoyusun.com/2013/08/24/a-glimpse-of-angularjs-scope-via-example.html" rel="nofollow">A Glimpse of Angular.js $scope via Example</a></h2> <address>at ruoyusun.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 16 hours ago <a href="/news/5983">discuss</a></p></article>
+<article data-news-id="5971"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="https://github.com/mauricecruz/chrome-devtools-zerodarkmatrix-theme" rel="nofollow">A highly customized dark theme for Chrome DevTools</a></h2> <address>at github.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">6</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 1 day ago <a href="/news/5971">discuss</a></p></article>
+<article data-news-id="5980"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://www.2ality.com/2013/08/protecting-objects.html" rel="nofollow">Protecting objects in JavaScript</a></h2> <address>at www.2ality.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 21 hours ago <a href="/news/5980">discuss</a></p></article>
+<article data-news-id="5979"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://adminjs.com/" rel="nofollow">AdminJS: The Backend-Agnostic Administration Framework</a></h2> <address>at adminjs.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 21 hours ago <a href="/news/5979">discuss</a></p></article>
+<article data-news-id="5934"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://carldanley.com/javascript-design-patterns/" rel="nofollow">JavaScript Design Patterns</a></h2> <address>at carldanley.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">9</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/carldanley">carldanley</a></username> 3 days ago <a href="/news/5934">discuss</a></p></article>
+<article data-news-id="5973"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://acko.net/blog/zero-to-sixty-in-one-second/" rel="nofollow">Fusing WebGL, CSS 3D and HTML</a></h2> <address>at acko.net</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">4</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/eskimoblood">eskimoblood</a></username> 1 day ago <a href="/news/5973">discuss</a></p></article>
+<article data-news-id="5978"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="https://github.com/pazguille/flipload" rel="nofollow">Flipload.js: Flipping elements and show a loading indicator easily</a></h2> <address>at github.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/pazguille">pazguille</a></username> 1 day ago <a href="/news/5978">discuss</a></p></article>
+<article data-news-id="5982"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://blog.sklambert.com/a-comprehensive-guide-to-taking-your-html5-game-offline/" rel="nofollow">A Comprehensive Guide to Taking your HTML5 Game Offline</a></h2> <address>at blog.sklambert.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">2</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 16 hours ago <a href="/news/5982">discuss</a></p></article>
+<article data-news-id="5981"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://jster.net/blog/javascript-data-structures" rel="nofollow">Get Most Out of JavaScript Data Structures</a></h2> <address>at jster.net</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">2</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 16 hours ago <a href="/news/5981">discuss</a></p></article>
+<article data-news-id="5975"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://swannodette.github.io/2013/08/24/es6-generators-and-csp/" rel="nofollow">ES6 Generators Deliver Go Style Concurrency</a></h2> <address>at swannodette.github.io</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 1 day ago <a href="/news/5975">discuss</a></p></article>
+<article data-news-id="5928"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://carldanley.com/js-module-pattern/" rel="nofollow">JS Design Patterns: The Module Pattern</a></h2> <address>at carldanley.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">7</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/carldanley">carldanley</a></username> 3 days ago <a href="/news/5928">discuss</a></p></article>
+<article data-news-id="5974"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://rfk.id.au/blog/entry/pypy-js-poc-jit/" rel="nofollow">PyPy.js Update: A Proof-of-Concept JIT</a></h2> <address>at rfk.id.au</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 1 day ago <a href="/news/5974">discuss</a></p></article>
+<article data-news-id="5952"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://yeoman.io/?v=1.0" rel="nofollow">Yeoman 1.0 has been released</a></h2> <address>at yeoman.io</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">5</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 2 days ago <a href="/news/5952">discuss</a></p></article>
+<article data-news-id="5941"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://wekeroad.com/2013/08/22/js-frameworks-are-amazing-and-no-one-is-happy" rel="nofollow">Javascript Frameworks Are Amazing and Nobody Is Happy</a></h2> <address>at wekeroad.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">5</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/eskimoblood">eskimoblood</a></username> 2 days ago <a href="/news/5941">discuss</a></p></article>
+<article data-news-id="5972"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://www.raymondcamden.com/index.cfm/2013/8/19/Using-Drawing-Tools-and-Maps-to-Find-Data" rel="nofollow">Using Drawing Tools and Maps to Find Data</a></h2> <address>at www.raymondcamden.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 1 day ago <a href="/news/5972">discuss</a></p></article>
+<article data-news-id="5970"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://www.codeschool.com/courses/discover-devtools" rel="nofollow">Discover DevTools - Free Code School course</a></h2> <address>at www.codeschool.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 1 day ago <a href="/news/5970">discuss</a></p></article>
+<article data-news-id="5969"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="https://github.com/getify/let-er" rel="nofollow">Transpile let(..) { .. } style block-scoped code into ES3 compatible JS</a></h2> <address>at github.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 1 day ago <a href="/news/5969">discuss</a></p></article>
+<article data-news-id="5965"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://carldanley.com/js-revealing-module-pattern/" rel="nofollow">The Revealing Module Pattern</a></h2> <address>at carldanley.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">4</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/carldanley">carldanley</a></username> 2 days ago <a href="/news/5965">discuss</a></p></article>
+<article data-news-id="5967"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://software.intel.com/en-us/blogs/2013/08/19/use-html5-device-orientation-to-run-windows-8-javascript-apps-on-android-devices" rel="nofollow">Use HTML5 device orientation to run Windows 8 javascript apps on Android devices</a></h2> <address>at software.intel.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 1 day ago <a href="/news/5967">discuss</a></p></article>
+<article data-news-id="5966"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://blogs.msdn.com/b/oldnewthing/archive/2013/08/19/10442582.aspx" rel="nofollow">The tiny table sorter - or - you can write LINQ in JavaScript</a></h2> <address>at blogs.msdn.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">3</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/%E7%B4%AB%E4%BA%91%E9%A3%9E">紫云飞</a></username> 1 day ago <a href="/news/5966">discuss</a></p></article>
+<article data-news-id="5873"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://blog.getbootstrap.com/2013/08/19/bootstrap-3-released/" rel="nofollow">Bootstrap 3 released</a></h2> <address>at blog.getbootstrap.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">10</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 5 days ago <a href="/news/5873">discuss</a></p></article>
+<article data-news-id="5956"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://www.thinkful.com/learn/javascript-best-practices-1/Avoid-Mixing-with-Other-Technologies" rel="nofollow">Javascript Best Practices Part 1</a></h2> <address>at www.thinkful.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">4</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 2 days ago <a href="/news/5956">discuss</a></p></article>
+<article data-news-id="5889"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://modernjavascript.blogspot.com/2013/08/promisesa-understanding-by-doing.html" rel="nofollow">Promises/A+ - understanding the spec through implementation</a></h2> <address>at modernjavascript.blogspot.com</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">8</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 5 days ago <a href="/news/5889">discuss</a></p></article>
+<article data-news-id="5783"><a class="uparrow" href="#up">&#9650;</a> <h2><a href="http://technical.io/" rel="nofollow">Tessel : an Internet-connected microcontroller for software developers, powered by JavaScript</a></h2> <address>at technical.io</address><a class="downarrow" href="#down">&#9660;</a><p><span class="upvotes">17</span> up and <span class="downvotes">0</span> down, posted by <username><a href="/user/echojs">echojs</a></username> 10 days ago <a href="/news/5783">1 comment</a></p></article>
+</section>
+</div>
+<footer><a href="/about">about</a> | <a href="http://github.com/antirez/lamernews">source code</a> | <a href="/rss">rss feed</a> | <a href="http://twitter.com/echojs">twitter</a></footer><script>setKeyboardNavigation();</script> <div style="display: none;" id="keyboard-help">
+<div class="keyboard-help-banner banner-background banner">
+</div>
+ <div class="keyboard-help-banner banner-foreground banner">
+<div class="primary-message">
+Keyboard shortcuts
+</div>
+ <div class="secondary-message">
+<div class="key">
+j/k:
+</div>
+<div class="desc">
+next/previous item
+</div>
+ <div class="key">
+enter:
+</div>
+<div class="desc">
+open link
+</div>
+ <div class="key">
+a/z:
+</div>
+<div class="desc">
+up/down vote item
+</div>
+</div>
+</div>
+</div>
+</div>
+</body>
+</html>
View
19 test/article.js
@@ -0,0 +1,19 @@
+var trumpet = require('../');
+var test = require('tape');
+var concat = require('concat-stream');
+var fs = require('fs');
+
+test(function (t) {
+ t.plan(2);
+
+ var tr = trumpet();
+ tr.createReadStream('article username').pipe(concat(function (body) {
+ t.equal(body.toString(), '<a href="/user/echojs">echojs</a>');
+ }));
+
+ tr.createReadStream('article span').pipe(concat(function (body) {
+ t.equal(body.toString(), '2');
+ }));
+
+ fs.createReadStream(__dirname + '/article.html').pipe(tr);
+});
Please sign in to comment.
Something went wrong with that request. Please try again.