It looks like the ALT_SEPARATOR is only defined on "dos-ish" platforms. https://github.com/ruby/ruby/blob/trunk/file.c#L5666-L5671. It's probably safe and more proper to just check the presence of the separator since it truly is only defined when the platform has alternative file separators.

Cygwin rightly doesn't count as dos-ish: https://github.com/ruby/ruby/blob/trunk/file.c#L2739-L2741