From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Taylan Kammer Newsgroups: gmane.lisp.guile.bugs Subject: bug#72374: srfi-64: test-apply does not accept convenience specifiers Date: Wed, 2 Oct 2024 00:17:01 +0200 Message-ID: <8b65bed6-fa95-4564-b690-b325afc32554@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10143"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Tomas Volf <~@wolfsden.cz>, 72374@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Oct 02 00:19:28 2024 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1svlDK-0002UM-K0 for guile-bugs@m.gmane-mx.org; Wed, 02 Oct 2024 00:19:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svlD0-0001Wa-GB; Tue, 01 Oct 2024 18:19:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svlCw-0001WI-Sd for bug-guile@gnu.org; Tue, 01 Oct 2024 18:19:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1svlCw-0002yF-Ii for bug-guile@gnu.org; Tue, 01 Oct 2024 18:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=eLIAjNvqBGIdSwikET18+VYL6u53ZE2QUrW5XljVyJ4=; b=YliJ75NdeaId7CCl2+0FWIhFIbrXJxHY/StyjHKmQtt41MaGcWShPfdqoZjXBumFd4Rs0gE7AMAiGey6CXOdtUPHTlkgYQmqVFBsZyTeAh8P4hydqFYR9Q5cz/PRNxQjUy+EVAESYo8a+gta1LI/BfTsMiLIPjPiygyF+MvlTNdAUSJ7sOViO4CkXoeztSiyJkEmb5obR+nXNHQMzqung08nqtle/HS3NoX8iQWcY0MZhz+84Z797lYXA1HejRPESJsRUfIatFQeBdHc3TtNMEzDfMjqEs3KFtQ0OFSM08pTm5gtXuTXwm/tg54c1blttpKfmoawDRRtA0vn9PPzIA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svlCw-0005ha-3H for bug-guile@gnu.org; Tue, 01 Oct 2024 18:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Taylan Kammer Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 01 Oct 2024 22:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72374 X-GNU-PR-Package: guile Original-Received: via spool by 72374-submit@debbugs.gnu.org id=B72374.172782108621887 (code B ref 72374); Tue, 01 Oct 2024 22:19:02 +0000 Original-Received: (at 72374) by debbugs.gnu.org; 1 Oct 2024 22:18:06 +0000 Original-Received: from localhost ([127.0.0.1]:54022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svlC2-0005gx-41 for submit@debbugs.gnu.org; Tue, 01 Oct 2024 18:18:06 -0400 Original-Received: from mail-ed1-f50.google.com ([209.85.208.50]:38501) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svlBz-0005gr-Nv for 72374@debbugs.gnu.org; Tue, 01 Oct 2024 18:18:04 -0400 Original-Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-5c895d975e5so389894a12.2 for <72374@debbugs.gnu.org>; Tue, 01 Oct 2024 15:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727821023; x=1728425823; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=eLIAjNvqBGIdSwikET18+VYL6u53ZE2QUrW5XljVyJ4=; b=aOiBD4palVGRPcOBctWdCg0qfQXgwTffl3JKpXZUU4WloA0hLz9T6bYVQLmE17Zqga yygX6j1lhEmrn+LoWIkH6rJwT4fMIXTdMk6J0/oc45M+AKo481N5boC7gnDfmkxictDt jy1aLs22h2qgpK6Y5PhwN+VX1FvDLzrN9WzzO0GswD24uIluT14gABBEoPXCwRL8bcyA QQdLQRnVYVol8q6LceJlsNtgBVH57j2nv/Ij5fobaRP3T1XDhlZbBpUhEoIYRHuuDU5+ Nhcs3RgQ94OmZuD2xZ8UAUc3RGbdzCBAseaNyzUeXyp5SVDwKjT31CKciHTSHdSX3sT6 mlew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727821023; x=1728425823; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eLIAjNvqBGIdSwikET18+VYL6u53ZE2QUrW5XljVyJ4=; b=BUjZBWLZE31EN38/Y3UR9n9EN6Wzpx4O6rIzrV/VouxgM2J/zTc073vrdnAtq9BEiK QF4g7lDRu3MLwvpLtmf/DnDEHmZtMJUDydZHLThnTMMkS3iITIKyHNKYvXfmSU45KzRb zwuLBlrnx7+Hv0Dyh8m+cgAVfJUuI00ABcJQ2rulgtCaae3HqsOANuvA+hPYwsqwBQwg t69egEwwUK3T+pC+YGMyhScvLLBb5P593n0gOFKcR2gD/4jK0vkNutD8Ek6YA8LjX8Uc bKLIA9Zpci154pOAxeFQaCGF7KT9qvqgt+Q52WjU4GaUOx9LUofnb14afGdsVe8NWu4i ZXCQ== X-Forwarded-Encrypted: i=1; AJvYcCVtgdj4zlcDlNBVYuF4YY72exSDLvNqnRo7JIpaJH0fdbtbpOQBziTiTbojaIiyqqgKI17PFA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwxptiXc5wj2ewpuJeTGOzkd3uBhQz/df/qYyqfDZSbGxoa+wzL 3GW4JKC+DknYJx0J8476XxkJCNnlrjbfrCJ667n1QTioHhfiW69d X-Google-Smtp-Source: AGHT+IG//ne+cm/OkEX0xQqRnR9DHbhckWQk0GfvvmgLn/11Aq0i78onbrWSzl4MUMmLHst11O0Cbw== X-Received: by 2002:a17:907:e8c:b0:a90:17fc:3f60 with SMTP id a640c23a62f3a-a98f8261956mr35629666b.8.1727821023020; Tue, 01 Oct 2024 15:17:03 -0700 (PDT) Original-Received: from ?IPV6:2003:106:8f04:c300:95ac:529d:6db3:196b? (p200301068f04c30095ac529d6db3196b.dip0.t-ipconnect.de. [2003:106:8f04:c300:95ac:529d:6db3:196b]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a93c2775b47sm782050466b.19.2024.10.01.15.17.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Oct 2024 15:17:02 -0700 (PDT) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:11005 Archived-At: On 30.07.2024 21:51, Tomas Volf wrote: > Hello, > > I think I found a bug in (srfi srfi-64) module shipped with GNU Guile. > > The specification says the following regarding the test-apply: > >> If one or more specifiers are listed then only tests matching the specifiers >> are executed. > The specifiers are defined in `Test specifiers' section: > >> [..] For convenience, a specifier may also be a non-procedure value, which is >> coerced to a specifier procedure, as described below for count and name. > That means that following should work: > > (use-modules (srfi srfi-64)) > (test-apply 1 (λ () (test-assert #t))) > > However it does not: > > Backtrace: > In ice-9/boot-9.scm: > 1752:10 12 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) > In unknown file: > 11 (apply-smob/0 #) > In ice-9/boot-9.scm: > 724:2 10 (call-with-prompt _ _ #) > In ice-9/eval.scm: > 619:8 9 (_ #(#(#))) > In ice-9/boot-9.scm: > 2836:4 8 (save-module-excursion _) > 4388:12 7 (_) > In srfi/srfi-64/testing.scm: > 947:34 6 (test-apply 1 #) > 944:21 5 (test-apply _ #) > 688:12 4 (_) > 648:2 3 (%test-on-test-begin #) > 266:21 2 (%test-should-execute #) > 257:17 1 (%test-any-specifier-matches (1) #) > 257:17 0 (%test-any-specifier-matches # …) > > srfi/srfi-64/testing.scm:257:17: In procedure %test-any-specifier-matches: > Wrong type to apply: 1 > > The string variant is also not supported, as in: > > (use-modules (srfi srfi-64)) > (test-apply "t-a" (λ () (test-assert #t))) > > Resulting in: > > [..] > srfi/srfi-64/testing.scm:257:17: In procedure %test-any-specifier-matches: > Wrong type to apply: "t-a" > > Have a nice day > Tomas Volf > Looks like a bug. Fixed in my implementation via this commit:     https://codeberg.org/taylan/scheme-srfis/commit/c14388e475dfe6a20cdd090d397813868dee0137 An equivalent fix shouldn't be *too* difficult to implement in the upstream implementation, but I'm not touching the test-apply implementation in there because it's demonic. :-) If someone wants to try it though, what's called `make-pred` in my code is called `%test-as-specifier` in the upstream code, and just like in my fix it just needs to be applied to the specifiers at some point to make sure they're all procedures. - Taylan