Debian Codegraph @

Changes

raw
1 Revision history for Test-MockFile
2
3 0.039 3/22/2026
4
5 [Bug Fixes]
6 - GH #292 - Return EPERM for unlink on directory on Solaris, matching
7 macOS/BSD behavior. PR #307
8 - GH #292 - Add 'no strict refs' to all dir operation CORE:: fallbacks
9 to fix bareword filehandle failures on Perl < 5.016. PR #307
10 - GH #298 - Don't apply umask to explicitly provided mode in file() and
11 new_dir() constructors. Fixes CPAN smoker failures with restrictive
12 umasks. PR #299
13 - GH #297 - Skip real-file flock test when filesystem lacks flock
14 support (e.g. NFS on FreeBSD). PR #300
15 - Propagate nlink to all same-inode mocks in link() so 3+ hard links
16 get consistent nlink values. PR #290
17 - Fix chown permission check for uid-only and gid-only changes that
18 previously skipped validation entirely. PR #290
19
20 [Maintenance]
21 - Modernize CI workflow with dynamic Perl versions, disttest job, and
22 macOS cross-platform coverage. PR #306
23 - Bump minimum Perl version to 5.16 and remove dead pre-5.16 code
24 paths. PR #305
25
26 0.038 3/20/2026
27
28 [Improvements]
29 - GH #70 - Auto-update stat timestamps (atime/mtime/ctime) during file
30 operations. PR #288
31 - GH #186 - Auto-update parent directory mtime on content changes. PR #288
32 - GH #3 - Add permission checking via set_user/clear_user. PR #281
33 - GH #44 - Add autodie compatibility with proper exception throwing.
34 - GH #16 - Add symlink() and link() overrides for mocked files.
35 - GH #24 - Add warnstrict mode for non-fatal strict violations.
36 - GH #39 - Override IO::File::open for mocked file compatibility.
37 - GH #135 - Add autovivify option for directory mocks.
38 - GH #139 - Override Cwd::abs_path to resolve mocked symlinks.
39 - GH #112 - Add flock() override for mocked files.
40 - GH #221 - Add truncate() override for mocked files.
41 - GH #111 - Add read(), write(), and append() helper methods.
42 - GH #27 - Support multiple file handles to the same mocked file.
43 - GH #158 - glob() now falls back to real filesystem for unmocked paths.
44 - GH #108 - Resolve . and .. in middle of paths.
45 - Add utime() override for mocked files.
46 - Add rename() override for mocked files.
47 - Implement SEEK whence support (SEEK_SET, SEEK_CUR, SEEK_END).
48 - Rewrite READLINE to support all $/ modes and implement GETC.
49 - Add :trace import tag for logging unmocked file accesses.
50 - Add file_passthrough() for strict-mode-compatible real filesystem
51 access with glob pattern support. PR #280
52
53 [Bug Fixes]
54 - GH #175 - Accept both EINVAL and ENOENT for readlink(undef).
55 - GH #179 - Fix filehandle reference leak. PR #276
56 - PRINT/PRINTF return false when weakened data ref is gone. PR #283
57 - Decrement nlink on unlink and preserve inode/nlink on rename. PR #276
58 - Set realistic nlink and unique inode defaults for mocked files.
59 - chmod/chown/utime/truncate now follow symlinks per POSIX. PR #287
60 - Use & ~umask instead of ^ umask for permission masking (multiple
61 locations).
62 - chown -1 now preserves per-file uid/gid instead of replacing with
63 process identity.
64 - Mask chmod mode with S_IFPERMS to prevent file type corruption.
65 - Use proper S_IFMT mask in is_link() to avoid false positives.
66 - Broken symlink stat sets ENOENT, not ELOOP.
67 - Use Errno constants instead of hardcoded errno values.
68 - PRINT writes at tell position instead of always appending.
69 - PRINT returns boolean 1, not byte count.
70 - Handle output record separator ($\) in PRINT for say() support.
71 - Update tell position after PRINT/WRITE/PRINTF operations.
72 - syswrite/printf must not inherit $\ from PRINT delegation.
73 - 2-arg open no longer dies on filenames with special characters.
74 - 2-arg open +>> mode parsing and opendir symlink following.
75 - readdir returns empty list (not undef) at EOF in list context.
76 - FileHandle CLOSE/DESTROY crash, WRITE negative offset, READ EBADF.
77 - Guard weakened data ref in tied filehandle methods.
78 - readline and getc on write-only handles now warn and return undef.
79 - READ returns EBADF on write-only handles, symlink size() returns
80 target length.
81 - sysopen without O_CREAT returns ENOENT for all modes.
82 - Allow seek past EOF and correct eof() behavior.
83 - seekdir with negative position no longer corrupts readdir.
84 - closedir double-close returns EBADF instead of passing to CORE.
85 - Dir ops on closed mock dirhandle warn instead of dying.
86 - Rename directory now re-keys children in mock registry.
87 - Rename directory over non-empty directory returns ENOTEMPTY.
88 - Rename to self no longer destroys file contents.
89 - Directory size() returns blksize instead of stringified arrayref.
90 - dir() constructor counts non-existent child mocks as content.
91 - rmdir ignores non-existent mock entries in directory.
92 - Set errno in __rmdir for undef path argument.
93 - unlink with no args now uses $_ for mocked files.
94 - Absolutify paths in _files_in_dir and _update_parent_dir_times.
95 - readlink returns ENOENT for non-existent mocks.
96 - lstat on unlinked symlink now returns ENOENT instead of stale stat.
97 - IO::File open on directory mocks returns EISDIR, append mode preserved.
98 - open/sysopen through broken symlink creates target file.
99 - Validate sysread length and return EINVAL on invalid seek whence.
100 - Correct blocks() calculation and remove dead code.
101 - Define S_IFPERMS locally instead of importing from Fcntl.
102 - Capture -s result before passing to is() for Perl < 5.16 compat.
103 - Apply permissions from sysopen O_CREAT 4th argument.
104 - Correct bareword check typo $_[9] -> $_[0] in dir functions.
105 - Pass missing args in chmod/chown passthrough to CORE.
106 - chown/chmod with broken symlinks no longer confess on multi-file lists.
107 - Use return undef in failure paths for correct list context.
108 - Truncate via read-only filehandle returns EINVAL.
109 - Add EISDIR checks, sysopen symlink following, and O_TRUNC dedup.
110
111 [Maintenance]
112 - Modernize CI workflow: upgrade checkout action and add Perl 5.40-5.42.
113 - Fix CI workflow permissions for code scanning. PR #284
114 - Refactor: improve readability and reduce duplication in MockFile.pm.
115 PR #284
116 - Add syswrite/sysread edge case test coverage. PR #282
117 - Correct MIN_PERL_VERSION and stale GitHub org URLs.
118 - Fix typos in error message and POD.
119
120 0.037 4/15/2025
121 - Fix unit test broken in perl 5.41.4
122
123 0.036 7/26/2023
124 - GH #181 - Detect incorrect usage of add_strict_rule_for_command
125
126 0.035 11/30/2022
127 - GH #180 - Prevent open() and sysopen() from opening GLOB(..)-like paths.
128
129 0.034 4/25/2022
130 - GH #176: Add file handle support for BINMODE. This does nothing at this
131 time but at least it doesn't die.
132 - support for ~/foo and ~user/foo in mocking and access (globs)
133
134 0.033 3/7/2022
135 - Request last Overload::FileCheck release - 0.013
136 - Correct chown parameter position for file name
137 - Fixup Plugin for File::Temp tempfile in scalar context logic.
138 - Track File::Temp version in unit tests.
139
140 0.032 2/24/2022
141 - Less strict mode - Don't complain about commands not opening or directly interacting with a file.
142
143 0.031 2/24/2022
144 - Fix for Plugin::FileTemp when calling tempfile in scalar context
145
146 0.030 2/22/2022
147 - Simplify _strict_mode_violation
148 - Introduce new_dir() to allow older dir() syntax.
149 - Provide a mechanism to setup custom strict rules
150 - Make is_strict_mode a helper
151 - Do not call _get_file_object when all we're trying to determine is if the file is mocked or not.
152 - Add Test::MockFile::Plugins
153 - We support "undef" as filename in strict rules to ignore filenames
154 - Block Plugin::FileTemp < 5.28
155 - Update MANIFEST
156
157 0.029 2/16/2022
158 - Fix broken link to small test documentation
159 - Ensure strict mode is enabled by default and prevent import conflicts.
160 - Fix warnings during global destruction
161 - Additional rules for _abs_path_to_file
162 - GH #103 - Update eg/example.pl:
163 - Add rmdir, mkdir and unlink default position
164 - Postpone file arg check during strict mode analysis
165 - Fixup hook args and teach for mkdir filename pos
166 - Perltidy policy changes.
167 - Use carp in filename and readlink
168 - Fix broken link to small test documentation
169
170 0.028 2/12/2022
171 - Update test for our FreeBSD results
172 - GH #122 - Support two-arg open, read/write, and understand pipes
173 - Add strict guards for additional keywords: readdir, telldir, rewinddir,
174 seekdir, closedir, readlink, mkdir, rmdir
175 - Revert to old symbol resolution technique.
176
177 0.027 2/10/2022
178 - GH #75 - Strict mode is now on by default
179 - GH #45 - Provide a helpful error message and document fileno unsupported.
180 - GH #90 - Normalize forward slashes.
181 - GH #126 - Document using debugger under strict mode.
182 - Do not hard-code values of $!
183 - Try to get more data when t/runtime-bareword-filehandles.t fails on cpan testers.
184 - GH #64 - Do not overwrite the error code when checking for Docker
185 - GH #63 - FreeBSD's readlink() returns EINVAL for readlink(undef):
186 - Add more data for debugging test failures on OpenBSD
187
188 0.026 2/3/2022
189 - Fix support for mocking the top-level directory.
190 - Symlinks should appear in readdir
191 - Fix directory instantiation when creating a symlink.
192 - GH #105: Show directories in readdir
193 - Improve relative path management
194 - Don't let stat() get confused with trailing forward slash
195 - GH #118: Do not get confused by inner directory files.
196 - GH #85: Do not corrupt blessed handles.
197
198 0.025 1/26/2022
199 - Fix typo in chmod mock. Was accidentally calling chown.
200 - Fix dependency on Text::Glob. It is now a runtime requirement.
201
202 0.024 1/24/2022
203 - Prefer Carp::confess to die
204 - Do not use "$!" in tests as it's not consistent across platforms
205 - GH #78: Do not allow rmdir on a populated directory.
206 - GH #73: Prefer the term ->path to ->filename as it is more clear between file/dir
207 - chown $fh now works.
208 - Only warn about mixed files when using mocked files
209
210 0.024_01
211 - GH #83: Get Solaris testers passing.
212 - Remove all use of "$!" in tests as this has tranlation problems.
213
214 0.023 1/14/2022
215 - GH #58: Fix synopsis typos
216 - GH #65: Fix typos in the typo fixes.
217 - GH #34: Support open() with barewords
218 - GH #59: Detect and reject common path mistakes when mocking
219 - GH #69: Redesigned dir() (and some file()) interface <--- breaks previous interface
220 - GH #40: Support glob()
221 - GH #15: Implement chown/chmod
222
223 0.022 12/27/2021
224 - GH #47: Manage bareword filehandles in runtime:
225
226 0.021 1/30/2020
227 - Emit ENOTDIR on opendir when appropriate
228 - Switch to github actions for CI testing
229
230 0.020 10/14/2019
231 - GH #51 - Basic introduction of file ownership. Set default uid/gid to current user when not set
232 - GH #49 - Make sysseek return position when called while allowing seek to return a true value.
233
234 0.19 5/21/2019
235 - Fix POD for stat example in POD.
236 - Allow scalar file handles on open. We don't care about those
237 - Provide better guidance about keeping your mocks in scope in examples
238 - Disable Test::CheckManifest due to break in Test-CheckManifest
239 - Fix seek bug in sysopen(... O_APPEND)
240
241 0.018 1/24/2019
242 - Properly handle open and sysopen file handles going out of scope.
243 - Provide a helper method to mock objects to determine the file name. GH #31
244 - Do not throw a file access hook when statting a file handle that is not under MockFile control. GH #30
245 - Read multiple lines via readline when wantarray is true. GH #29
246
247 0.017 1/2/2019
248 - Require a newer Test2::Bundle::Extended (0.000084) to support named isa_ok
249
250 0.016 1/2/2019
251 - Bump Overload::FileCheck to 0.007 to address stack bug
252 - Try to get EISDIR handling for BSD working. Apparently something changed in perl 5.20?
253 - Do not do access hooks on filehandle interactions.
254
255 0.015 12/21/2018
256 - Remove errant debug messages from open
257 - Pass 3 to fix t/touch.t on BSD.
258
259 0.014 12/20/2018
260 - Re-factor _find_file_or_fh to handle symlink following logic better. GH #26
261 - Make more standard use of _get_file_object when looking up a file path so we
262 properly handle abs path and symlink following
263
264 0.013 12/20/2018
265 - Add a helper to determine if goto can be used. Where it's available is complicated
266 - First pass at bareword file handles for opendir and friends
267 - Fix errant docs for making a symlink mock
268 - Follow links for stat but not lstat
269 - Add support for readlink
270 - Try 2 to fix BSD issues with GH #20
271
272 0.012 11/16/2018
273 - Fix for #21 - length undef on perl 5.10
274 - GH #20 - Add EPERM support for freebsd when unlinking directories
275 - Fix for print $fh undef throwing a warning
276 - Remove faulty OS level test of readdir after opendir.
277
278 0.011 11/08/2018
279 - Fix for my $file_contents = do { local $/; <$fh> };
280 - Mock CORE::GLOBAL::unlink and support directories for unlink
281 - Mock CORE::GLOBAL::mkdir
282 - Mock CORE::GLOBAL::rmdir
283 - MockFile->symlink now follows the symlink norm of ($target, $file), not the reverse.
284 - New mock helper 'exists' to check if the file is there.
285 - New mock helper 'permissions' tells you the current permissions of the mocked file.
286
287 0.010 10/31/2018
288 - Add .perltidyrc policy
289 - When reporting strict mode violations, be sure to report the a stack location outside of our modules.
290 - Report a stack trace for strict mode violations to determine the source of the problem.
291 - Add an ignore hash for modules (like DynaLoader) which are allowed to open files.
292 - Ignore STDIN/STDERR/STDOUT since tests often have to manipulate them and that's not really IO.
293 - Autovivify a sysread where the buffer passed in is undef.
294
295 0.009 10/29/2018
296 - Add unlink and touch as helpers when testing
297 - Depend on new Overload::FileCheck 0.006 which does not call MockFile to determine _ stats
298
299 0.008 10/26/2018
300 - Depend on newest Overload::FileCheck version. Depending on older
301 versions was breaking unit tests.
302
303 0.007 10/25/2018
304 - More POD fixups
305 - Support for unmocked file access hooks.
306 - Implement strict mode to error any time an unmocked file access happens.
307
308 0.006 10/25/2018
309 - Fix for Locale-dependent failures on perl < 5.22
310 https://github.com/CpanelInc/Test-MockFile/issues/10
311 - Minor pod fixups.
312
313 0.005 10/24/2018
314 - Complete basic documentation for all public methods.
315
316 0.004 10/24/2018
317 - Raise the Test::More requirement to address an issue with Test2::Formatter::TAP
318 Fixes https://github.com/CpanelInc/Test-MockFile/issues/6
319
320 0.003 10/24/2018
321 - Correct bug in use constant statement. 0.002 was broken on release.
322 - Changes to code to give basic support for Perl 5.10+. Ideally you should be on
323 perl 5.16 to run this code but it'll mostly work below that.
324
325 0.002 10/24/2018
326 - Set bug tracker to github
327 - Fix Fcntl bug when you use unsupported constants.
328
329 0.001 10/23/2018
330 - First release with basic support for open/sysopen/opendir
331 - Support is limited to Perl 5.20 until we address this error:
332 Error: Invalid CODE attribute: prototype(*;$@) at lib/Test/MockFile.pm
333