GithubHelp home page GithubHelp logo

fileno unimplemented about test-mockfile HOT 8 CLOSED

cpanel avatar cpanel commented on May 27, 2024
fileno unimplemented

from test-mockfile.

Comments (8)

FGasper avatar FGasper commented on May 27, 2024

How would this work? The point of Test::MF is precisely that there is no underlying file descriptor.

from test-mockfile.

toddr avatar toddr commented on May 27, 2024

Randomly pick a number above 30 and below 1024? Check via posix if it handle is open?

Sure, someone could come along and use it out from under you. But I suspect it would be unlikely to affect the test

from test-mockfile.

toddr avatar toddr commented on May 27, 2024

The code just needs to be filled in here https://github.com/CpanelInc/Test-MockFile/blob/master/lib/Test/MockFile/FileHandle.pm#L350

from test-mockfile.

FGasper avatar FGasper commented on May 27, 2024

I suppose that would facilitate same-filehandle checks, so I could see that being useful. It still seems pretty edge-y and not unlikely to lead to misuse and/or confusion.

from test-mockfile.

toddr avatar toddr commented on May 27, 2024

I can't come up with anything positive you might do with fileno that might not lead to side effects.

I might be ok with us dieing in strict mode if fileno is called as this is unsupported for anything mocked.

from test-mockfile.

FGasper avatar FGasper commented on May 27, 2024

Yeah I’d think die()ing. There is no file descriptor for these filehandles; if you need a “real” test filehandle, use File::Temp?

from test-mockfile.

toddr avatar toddr commented on May 27, 2024

We could do File::Temp but let's do die first and then if people want it, we'll think about enabling File::Temp on-demand if people need fileno for tests. Honestly, fileno is kinda a rare call in most code bases.

from test-mockfile.

FGasper avatar FGasper commented on May 27, 2024

I meant that the caller could do File::Temp. Seems out of scope for this library.

from test-mockfile.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.