You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
╰─> perl test.pl
####################
# line 1
# line 2
# line 3
# line 4
# line 5
# line 6
####################
####################
CLEAR
####################
if we now uncomment the line which mocks the file
# Note: commenting this file show the broken behavior
## ----
my $mock_file = Test::MockFile->file( $test_file => '' );
## ---
The output becomes
╰─> perl test.pl
####################
# line 1
# line 2
# line 3
# line 4
# line 5
# line 6
####################
####################
# line 1
# line 2
# line 3
# line 4
# line 5
# line 6
CLEAR
####################
we can see that the seek + truncate do not work as expected
The text was updated successfully, but these errors were encountered:
I think the difference between "bug" and "enhancement" is whether this is a described or expected behavior. Since this is not described (though makes sense to be expected), I labeled it as both "bug" and "enhancement."
As shown with that example
truncate
+tell
are not supported by Test::MockFile.We should consider adding a die/warning when using it on a mocked file, before providing a correct interface for them
Using this script as a proof of concept
When run without mocking the file the output is
if we now uncomment the line which mocks the file
The output becomes
we can see that the seek + truncate do not work as expected
The text was updated successfully, but these errors were encountered: