From 992952d8f6101ebefecf6ca5291d31290da8862f Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 25 Feb 2021 18:22:49 +0000 Subject: fix corner cases with `exports` (#4691) --- test/compress/exports.js | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) (limited to 'test/compress') diff --git a/test/compress/exports.js b/test/compress/exports.js index e0690503..425b0245 100644 --- a/test/compress/exports.js +++ b/test/compress/exports.js @@ -227,3 +227,77 @@ keep_return_values: { } } } + +in_use: { + options = { + pure_getters: "strict", + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + export function f() {} + f.prototype.p = 42; + } + expect: { + export function f() {} + f.prototype.p = 42; + } +} + +in_use_default: { + options = { + pure_getters: "strict", + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + export default function f() {} + f.prototype.p = 42; + } + expect: { + export default function f() {} + f.prototype.p = 42; + } +} + +single_use: { + options = { + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + export function f() { + console.log("PASS"); + } + f(); + } + expect: { + export function f() { + console.log("PASS"); + } + f(); + } +} + +single_use_default: { + options = { + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + export default function f() { + console.log("PASS"); + } + f(); + } + expect: { + export default function f() { + console.log("PASS"); + } + f(); + } +} -- cgit v1.2.3 mmitter'>committer
path: root/tests/git-authenticate.scm
AgeCommit message (Expand)Author
2020-06-28tests: Allow 'tests/git-authenticate.scm' to run when git/gpg is missing....Fixes <https://bugs.gnu.org/42077>. Reported by Jan Nieuwenhuizen <janneke@gnu.org>. The typo was introduced in 7b06781a58326f251c4af6340379d68e3cb98adb. * tests/git-authenticate.scm <top level>: Remove call to 'which' around (gpg+git-available?). Ludovic Courtès
2020-06-20tests: Skip tests that requires gpg when gpg is unavailable....Partly fixes <https://bugs.gnu.org/41932>. Reported by Simen Endsjø <simendsjo@gmail.com>. * tests/git-authenticate.scm ("signed commits, SHA1 signature"): Use 'gpg+git-available?' in skip guard. Ludovic Courtès
2020-06-16tests: Move OpenPGP helpers to (guix tests gnupg)....* tests/git-authenticate.scm (key-id): Remove. (%ed25519-public-key-file, %ed25519-secret-key-file) (%ed25519bis-public-key-file, %ed25519bis-secret-key-file) (read-openpgp-packet, key-fingerprint): Move to... * guix/tests/gnupg.scm: ... here. Ludovic Courtès
2020-06-12git-authenticate: Disallow SHA1 (and MD5) signatures....* guix/git-authenticate.scm (commit-signing-key): Add #:disallowed-hash-algorithms and honor it. (authenticate-commit)[recent-commit?]: New variable. Pass #:disallowed-hash-algorithms to 'commit-signing-key'. * tests/git-authenticate.scm ("signed commits, SHA1 signature"): New test. Ludovic Courtès
2020-06-07git-authenticate: Prevent removal of '.guix-authorizations'....* guix/git-authenticate.scm (commit-authorized-keys) [parents-have-authorizations-file?, assert-parents-lack-authorizations]: New procedures. Use the latter before returning DEFAULT-AUTHORIZATIONS. * guix/git.scm (false-if-git-not-found): Export. * guix/tests/git.scm (populate-git-repository): Add 'remove' clause. * tests/git-authenticate.scm ("signed commits, .guix-authorizations removed"): New test. Ludovic Courtès
2020-06-05git-authenticate: Add tests....* guix/tests/git.scm (call-with-environment-variables) (with-environment-variables): Remove. * guix/tests/git.scm (populate-git-repository): Add clauses for signed commits and signed merges. * guix/tests/gnupg.scm: New file. * tests/git-authenticate.scm: New file. * tests/ed25519bis.key, tests/ed25519bis.sec: New files. * Makefile.am (dist_noinst_DATA): Add 'guix/tests/gnupg.scm'. (SCM_TESTS): Add 'tests/git-authenticate.scm'. (EXTRA_DIST): Add tests/ed25519bis.{key,sec}. Ludovic Courtès