On 6/11/26 8:10 AM, Waldek Hebisch wrote:
> On Thu, Jun 11, 2026 at 06:36:11AM +0800, Qian Yun wrote:
>> On 6/11/26 5:37 AM, Waldek Hebisch wrote:
>>>
>>> One possibility is to allow this test to fail. IIUC this currently
>>> causes CI failure but I hope it is possibile to ignore this test in CI.
>>>
>>> I used file in root directory in hope of getting test independent
>>> of operating system. So another way is to use test depending on
>>> OS (on Unix using touch + chmod to get desired permissions) and use
>>> assertions to activate it or choose correct version.
>>>
>>
>> OK, two workarounds:
>>
>> 1. open an existing directory as file will fail.
>>
>> 2. open a file which parent directory does not exist will fail.
I tried this approach, to open "/foo/bar" in the test.
This fixes for sbcl, but still fails for CCL.
That's because we pass ":if-does-not-exist :create" to "open".
For CCL, on windows, normal user, openIfCan("/foo", "output")
fails because of permission failure, but it succeeds for
"/foo/bar"!
Anyway, CCL's behavior is different, because it can create
directories. Shall we try to make different Lisps consistent here?
- Qian
> To explain motivation: before change when trying to open file for
> input 'open_stream' would just retrun 'nil'. But in case of permission
> failure Lisp 'open' signals an error and apparently no portable
> keyword can change that. The intent of the test was to verify that
> we get return value instead of an error. In 'sbcl' trying to
> open file for writing in not exising directory gives error, so
> that would be enough as general test of involved machinery.
> OTOH it would be nice to have more direct test, which fails
> due to access rights (internally in Lisp implementation the
> various variants may correspond to different code paths with
> different handling).
>
> As you noted, things that are not tested by testsuite may too
> easily get broken, so I wanted to add a test. If we can not
> do better, testing open for writing in not exising directory
> may be good enough.
>
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/fricas-devel/8db7dbe4-0979-48d3-80ae-e758fa41e165%40gmail.com.