From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Taylan Kammer Newsgroups: gmane.lisp.guile.user Subject: Re: SRFI-64: test exception symbol Date: Fri, 1 May 2020 11:58:41 +0200 Message-ID: <920a5e8d-f1fd-6efa-b57a-9957f76784c6@gmail.com> References: <20200430150621.GA16174@newvzh.lokolhoz> <20200430155509.GB16174@newvzh.lokolhoz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="49598"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri May 01 11:59:00 2020 Return-path: Envelope-to: guile-user@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 1jUSRf-000Cjk-O3 for guile-user@m.gmane-mx.org; Fri, 01 May 2020 11:58:59 +0200 Original-Received: from localhost ([::1]:40114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUSRe-0007Fs-MW for guile-user@m.gmane-mx.org; Fri, 01 May 2020 05:58:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57730) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUSRU-0007Fh-Ux for guile-user@gnu.org; Fri, 01 May 2020 05:58:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUSRT-0000v6-Tw for guile-user@gnu.org; Fri, 01 May 2020 05:58:48 -0400 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:32919) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUSRT-0000fx-F2 for guile-user@gnu.org; Fri, 01 May 2020 05:58:47 -0400 Original-Received: by mail-wr1-x435.google.com with SMTP id h9so624795wrt.0 for ; Fri, 01 May 2020 02:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=oDcZs4T/VBOxOXon+MRQndZ1RI/tm3TsPdKx9S/C4pY=; b=NqVycNe2KIJkxawR6sWsXklmHpsnC94s/gSe1cKQxXQPR7s4PjpSQxstJjJYTbUfcC VTvd6hK4tvzcis+U//8hvosx61hm5oHDOegO2YXBKtfDdWgcBY/C1vUYNP/LnP7Z1i/a qHR58CZv+UsgiZai1oIgE8tZVKizpjaicQVv3bEW0f5LraNZU8DG/CiUDYptlMaNQvbo AY4Jebtvv/TjqkG/7xWFi/fLMFuhR3sc9eSZQ4lec0EldBT2mEaDoK7AoDINe/nvUEmp 7v71XaPVKj3foLwWX8HDVNe6NY+cKFE7anl9sNFZ3W4/+j7NBpcWfMbiQx1QUGbPr4yw fD0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oDcZs4T/VBOxOXon+MRQndZ1RI/tm3TsPdKx9S/C4pY=; b=hDuCe3z6L4+iWKwQ8TClVmiNEnWhf1EkLCVoF/fUobfMigspCUUlWPi3sT2sBmTDlW lIurX2W96ZRC2MNkVfybPH6wIAIY7pME/WrAFnxqv5TP8TFvAd7VXhaNTobTNBv3k7Mx OrNZ2F5TlFiaAJuIn6//CmhsJkqImDyi5Fn0Ds7G7UUinylZG2xe1/286arfogoTsGWM R2oJ/qhAf88B352aQh51t2cGfKJnS0v56t4z/0uEdvKxupNcPxLdUqro41h0Q+ohtKaT 43r+5jAz7iUZV9kZXvzfFqq69qg56knUscq8vwEvsnEUimYjnB3E7UNVdA9BuH8+OaOf elzw== X-Gm-Message-State: AGi0Pub67eik5GW5mfhzv1whLCK/37ItUJM+6tkjorbh23ce6juj2g6C mzx4fsbrkh/rwclvO3c56flFJgeA X-Google-Smtp-Source: APiQypKaiPjgZLVgA275jXgWDIZAxE0c04kVnTHGuX+M4SbsLi55wJyse0w3tBQRERosOmttDxRHvA== X-Received: by 2002:a5d:6647:: with SMTP id f7mr3617884wrw.41.1588327125364; Fri, 01 May 2020 02:58:45 -0700 (PDT) Original-Received: from ?IPv6:2a02:908:c70:52c0:818:bc68:d925:ba7e? ([2a02:908:c70:52c0:818:bc68:d925:ba7e]) by smtp.gmail.com with ESMTPSA id 17sm3206835wmo.2.2020.05.01.02.58.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 May 2020 02:58:44 -0700 (PDT) In-Reply-To: <20200430155509.GB16174@newvzh.lokolhoz> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=taylan.kammer@gmail.com; helo=mail-wr1-x435.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::435 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16412 Archived-At: On 30.04.2020 17:55, Vladimir Zhbanov wrote: > On Thu, Apr 30, 2020 at 06:06:21PM +0300, Vladimir Zhbanov wrote: >> Hi, >> >> In SRFI-64, is there a way to test what exception raised using >> test-error() or anything else? I know about looking into test >> logs (if 'test-error' is used), though that's not what I need. I >> need a way to be sure a test raises the exception it should raise. The test-error form takes two optional operands before the test expression. It's defined as: (test-error [[test-name] error-type] test-expr) Evaluating test-expr is expected to signal an error. The kind of error is indicated by error-type. If the error-type is left out, or it is #t, it means "some kind of unspecified error should be signaled". For example: (test-error #t (vector-ref '#(1 2) 9)) This specification leaves it implementation-defined (or for a future specification) what form test-error may take, though all implementations must allow #t. Some implementations may support SRFI-35's conditions, but these are only standardized for SRFI-36's I/O conditions, which are seldom useful in test suites. An implementation may also allow implementation-specific "exception types". For example Java-based implementations may allow the names of Java exception classes: ;; Kawa-specific example (test-error (vector-ref '#(1 2) 9)) An implementation that cannot catch exceptions should skip test-error forms. My SRFI-64 implementation allows the error-type operand to be a predicate (one-argument procedure that returns a Boolean) to allow maximum flexibility. It's found here: https://github.com/TaylanUB/scheme-srfis - Taylan