mruby-io: raise NotImplementedEerror for FileTest.pipe? on Windows

add Windows guard to FileTest.pipe? to raise NotImplementedError,
consistent with symlink? and socket?. Windows anonymous pipes created
by IO.pipe are not UNIX FIFOs and cannot be detected via stat mode
bits. the test suite expects this exception and handles it with skip.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-10-20 08:18:38 +09:00
parent a28ada5e5e
commit bbf46a4355
+5
View File
@@ -106,6 +106,10 @@ mrb_filetest_s_directory_p(mrb_state *mrb, mrb_value klass)
static mrb_value
mrb_filetest_s_pipe_p(mrb_state *mrb, mrb_value klass)
{
#ifdef _WIN32
/* Windows anonymous pipes are not Unix FIFOs */
mrb_raise(mrb, E_NOTIMP_ERROR, "pipe? is not supported on Windows");
#else
#ifdef S_IFIFO
# ifndef S_ISFIFO
# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
@@ -121,6 +125,7 @@ mrb_filetest_s_pipe_p(mrb_state *mrb, mrb_value klass)
#endif
return mrb_false_value();
#endif
}
/*