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#72376: srfi-64: test-equal evaluates test-name multiple times Date: Wed, 2 Oct 2024 00:21:51 +0200 Message-ID: <4ad1e8e1-0797-4a8c-8a19-629986b5e4b7@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------y0hoVYQQNhkoSYwv0xIYso7f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26482"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: Tomas Volf <~@wolfsden.cz>, 72376@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Oct 02 00:23:20 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 1svlH6-0006kB-9o for guile-bugs@m.gmane-mx.org; Wed, 02 Oct 2024 00:23:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1svlGr-00022g-7N; Tue, 01 Oct 2024 18:23:05 -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 1svlGp-00022Q-8g for bug-guile@gnu.org; Tue, 01 Oct 2024 18:23: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 1svlGp-0003f1-0U for bug-guile@gnu.org; Tue, 01 Oct 2024 18:23:03 -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=MkntKs4855hlmTUtYHB/gsEz/VkS1EQBco8Q6olaBmI=; b=mIA61XofZ2qWmdqmt+ioJF3odPOZz3E/yWO7TSgSew1lPV+bOf8L+ROv2rzOPeLB1eyrzJbFTUT9c1g7Pti/xVmLQ7Fipc5/OSMJHfK9+2JZgXOOKAqmxbxoUuWds7RUpBAfluaKqedetPkh3rDtGbUZ83SmunJXJntYHYfB5YO+ougI0h6Fj8B9fswmo/jLhTZim+vZEd7lru0mOm5U9UjDSQjZyRz0BJB6QPCR8NmHqREfN87Wgq2RXQtwC1HJE+UC8WAnDCbZ61Cclr42ufGIyKEyo+Q5tPi7ig/zRwdF/j4yy5k3V0lZYXYg0/fS66HI1UviEEbM3t3PC0uB+Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1svlGo-0005ts-Hk for bug-guile@gnu.org; Tue, 01 Oct 2024 18:23: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:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72376 X-GNU-PR-Package: guile Original-Received: via spool by 72376-submit@debbugs.gnu.org id=B72376.172782138122656 (code B ref 72376); Tue, 01 Oct 2024 22:23:02 +0000 Original-Received: (at 72376) by debbugs.gnu.org; 1 Oct 2024 22:23:01 +0000 Original-Received: from localhost ([127.0.0.1]:54049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svlGm-0005tM-HP for submit@debbugs.gnu.org; Tue, 01 Oct 2024 18:23:00 -0400 Original-Received: from mail-ej1-f41.google.com ([209.85.218.41]:39851) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svlGl-0005t7-3X for 72376@debbugs.gnu.org; Tue, 01 Oct 2024 18:22:59 -0400 Original-Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a90f263c60fso28996166b.3 for <72376@debbugs.gnu.org>; Tue, 01 Oct 2024 15:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727821314; x=1728426114; darn=debbugs.gnu.org; h=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=MkntKs4855hlmTUtYHB/gsEz/VkS1EQBco8Q6olaBmI=; b=CELKH5JijFa7/NkKM5BmqB0uHhT6Tnu18DF8eUHChqg9echAhYvP1vQbUTGhXRr5IY 26ApQCCSh8w7A10d4dy7ghMb1yqiHbRlGqmA9fPR832hnGupWeQFHkCNJDWLDfHG9sra pCpEtJ7chiOdr0cApKoCXDuZBWbWH/jBGHIt9KH09mPyCqLF3llFFLdrKVo1mb9AwrQs kyepBE6sWCaHLcbAMJLvL0Sf1xfYCQPTmmQEVDqg0EC4o6AzCpVl7neZkiDu22ukFB+U 4DRo2Ln1t7080bZIE+pciv1IzzFPM9Oq82c3Wuy6Tg/XFqaFo6Uv4RBMXLQsQAPOneON 7LNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727821314; x=1728426114; h=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=MkntKs4855hlmTUtYHB/gsEz/VkS1EQBco8Q6olaBmI=; b=Tvuqj4W4F9CCAty6xcxpDY2G4m2LI7mwzUD+KWH9XJMVQgPBu4WJZ1u7RPHh0AQ54v gBls1MW3iITYWyxKtqnv4o6sB5jJOjANc1eClIaUiVfm/E5acFIQgt/caweqJWbWdfha 1eZkQY5dnmKIh0NuzgR6n6aVJmgsau9+Pi7MXdfTVVU+PIiJf6uW1B3dkRhbwRPWsqpt TcTNUbLWqVIByOC7OaFWh192RdXCo2ALoH4lHCDTHBBk23b9S6DIXeYYxSqD461zvwzf HHhu9+cC+P+KlOXXU2xGboWeHjDuNTKdBE4i+GRNhLllSKlSxWwyDLWAf8vcjxVlSyrp 25Kw== X-Forwarded-Encrypted: i=1; AJvYcCWK+ar4348ePcjTthv0XHo0XNRWo0tHUyfRwT4kMswM3ormI5QVVdEvaOoY0UVje0AmUDMydQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwgfWjoAtswGm8ID35mp+35KmQvUapUsoFwMMFlr80jC04I9KwP ip772M1LUG0TYq2QI8cK6E/UhYYbC3p9vZB3moqvwpgueWz6s6T74UZrM/31 X-Google-Smtp-Source: AGHT+IGR5YhqFSbjwJVUeqSdnL83SWTV/yeaVV6mdYn34+Z96Vw94/xFUFhbbDiaLSvNiMM8+PkXAQ== X-Received: by 2002:a17:907:6d03:b0:a8d:2623:cd4a with SMTP id a640c23a62f3a-a98f8386da0mr37945666b.12.1727821313426; Tue, 01 Oct 2024 15:21:53 -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-a93c297a30dsm770809366b.160.2024.10.01.15.21.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Oct 2024 15:21:53 -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:11007 Archived-At: This is a multi-part message in MIME format. --------------y0hoVYQQNhkoSYwv0xIYso7f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 that test-equal is equivalent to: > >> (test-assert [test-name] (equal? expected test-expr)) > Hence the test-assert's requirement to evaluate test-name only once applies. > > However the test-name is evaluated multiple times: > > (use-modules (srfi srfi-64)) > (test-begin "x") > (test-equal (pk "t") #t #t) > > Leading to: > > ;;; ("t") > > ;;; ("t") > > Have a nice day > Tomas Volf > > Same exact deal as in bug reports 72372, 72373, and 72375. Fixing 72375 would fix this one too, as test-eq, test-eqv, and test-equal share a helper procedure, and the bug is in that helper procedure. Already fixed in my implementation. - Taylan --------------y0hoVYQQNhkoSYwv0xIYso7f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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 that test-equal is equivalent to:

(test-assert [test-name] (equal? expected test-expr))
Hence the test-assert's requirement to evaluate test-name only once applies.

However the test-name is evaluated multiple times:

    (use-modules (srfi srfi-64))
    (test-begin "x")
    (test-equal (pk "t") #t #t)

Leading to:

    ;;; ("t")

    ;;; ("t")

Have a nice day
Tomas Volf


Same exact deal as in bug reports 72372, 72373, and 72375.

Fixing 72375 would fix this one too, as test-eq, test-eqv, and test-equal share a helper procedure, and the bug is in that helper procedure.

Already fixed in my implementation.

- Taylan

--------------y0hoVYQQNhkoSYwv0xIYso7f--