[Pkg-javascript-commits] [node-browser-pack] 12/141: failing test for trailing comments

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:23:20 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-browser-pack.

commit d84db62bd8c9a295ada4cf5745fef65b935f8d17
Author: James Halliday <mail at substack.net>
Date:   Wed Feb 20 08:42:45 2013 +1000

    failing test for trailing comments
---
 test/comment.js | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/test/comment.js b/test/comment.js
new file mode 100644
index 0000000..8aa3e1b
--- /dev/null
+++ b/test/comment.js
@@ -0,0 +1,31 @@
+var test = require('tape');
+var pack = require('../');
+
+test('trailing comment', function (t) {
+    t.plan(5);
+    
+    var p = pack({ raw: true });
+    var src = '';
+    p.on('data', function (buf) { src += buf });
+    p.on('end', function () {
+        var r = Function(['T'], 'return ' + src)(t);
+        t.equal(r('xyz')(5), 555);
+        t.equal(r('xyz')(5), 555);
+        t.equal(r('zzz'), undefined);
+    });
+    
+    p.write({
+        id: 'abc',
+        source: 'T.equal(require("./xyz")(3), 333)',
+        entry: true,
+        deps: { './xyz': 'xyz' }
+    });
+    
+    p.write({
+        id: 'xyz',
+        source: 'T.ok(true); module.exports=function(n){return n*111}'
+            + ' // trailing comment'
+    });
+    
+    p.end();
+});

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-browser-pack.git



More information about the Pkg-javascript-commits mailing list