var assert = require("assert"); var uglify = require("../../"); describe("New", function() { it("Should add trailing parentheses for new expressions with zero arguments in beautify mode", function() { var tests = [ "new x(1);", "new x;", "new new x;", "new (function(foo){this.foo=foo;})(1);", "new (function(foo){this.foo=foo;})();", "new (function test(foo){this.foo=foo;})(1);", "new (function test(foo){this.foo=foo;})();", "new true;", "new (0);", "new (!0);", "new (bar = function(foo) {this.foo=foo;})(123);", "new (bar = function(foo) {this.foo=foo;})();" ]; var expected = [ "new x(1);", "new x();", "new new x()();", "new function(foo) {\n this.foo = foo;\n}(1);", "new function(foo) {\n this.foo = foo;\n}();", "new function test(foo) {\n this.foo = foo;\n}(1);", "new function test(foo) {\n this.foo = foo;\n}();", "new true();", "new 0();", "new (!0)();", "new (bar = function(foo) {\n this.foo = foo;\n})(123);", "new (bar = function(foo) {\n this.foo = foo;\n})();" ]; for (var i = 0; i < tests.length; i++) { assert.strictEqual( uglify.minify(tests[i], { output: {beautify: true}, compress: false, mangle: false }).code, expected[i] ); } }); it("Should not add trailing parentheses for new expressions with zero arguments in non-beautify mode", function() { var tests = [ "new x(1);", "new x;", "new new x;", "new (function(foo){this.foo=foo;})(1);", "new (function(foo){this.foo=foo;})();", "new (function test(foo){this.foo=foo;})(1);", "new (function test(foo){this.foo=foo;})();", "new true;", "new (0);", "new (!0);", "new (bar = function(foo) {this.foo=foo;})(123);", "new (bar = function(foo) {this.foo=foo;})();" ]; var expected = [ "new x(1);", "new x;", "new(new x);", "new function(foo){this.foo=foo}(1);", "new function(foo){this.foo=foo};", "new function test(foo){this.foo=foo}(1);", "new function test(foo){this.foo=foo};", "new true;", "new 0;", "new(!0);", "new(bar=function(foo){this.foo=foo})(123);", "new(bar=function(foo){this.foo=foo});" ]; for (var i = 0; i < tests.length; i++) { assert.strictEqual( uglify.minify(tests[i], { output: {beautify: false}, compress: false, mangle: false }).code, expected[i] ); } }); });itute ‘guix-cookbook’ for copy/pasted ‘guix-manual’. Reported-by: jetomit on #guix Tobias Geerinckx-Rice 2019-09-18doc: Add Guix Cookbook....* .gitignore: Update ignore list. * Makefile.am (assert-no-store-file-names): Exclude the cookbook. * bootstrap: Generate po files for cookbook translations. * doc/guix-cookbook.texi: New file. * doc/local.mk (info_TEXINFOS): Add it; add a rule to build cookbook translations. * po/doc/local.mk (DOC_COOKBOOK_PO_FILES): New variable. (EXTRA_DIST): Add cookbook pot file and po files. (doc-po-update-cookbook-%): New target. (doc-pot-update): Also update cookbook pot file. (doc-po-update): Also update cookbook po files. Ricardo Wurmus f05320aa87df06d0'>database: Remove #:deduplicate? and #:reset-timestamps? from 'register-path'....* guix/store/database.scm (register-path): Remove #:deduplicate? and #:reset-timestamps?. * guix/scripts/system.scm (copy-item): Adjust accordingly. * tests/store-database.scm ("register-path") ("register-path, directory"): Call 'reset-timestamps'. Ludovic Courtès 2020-11-21store-database: Add test checking the directory mtime after 'register-path'....* tests/store-database.scm ("register-path, directory"): New test. Ludovic Courtès