-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add primaries to _test #23
Conversation
hey many thanks for adding this. yeah ideally we'd merge with tests and docs (the docs are automatically extracted from the comments above the if you can't figure out why |
Just create special files (socket, fifo, block, character, not sure which I can add docs and tests. |
thanks, looking forward to it |
a block device (
a character device ( symlink, file, directory work fine. haven't tested sockets. |
added docs and (repetitive) tests. git apparently doesn't track block / character / fifo files, so those have to be created somehow. |
ok removed tests for files git doesn't track, the |
http://superuser.com/questions/440873/git-unable-add-device-file https://github.com/git/git/blob/master/dir.c#L1028-1036
|
|
||
var result = shell.test('-f', 'resources/link'); | ||
assert.equal(shell.error(), null); | ||
assert.equal(result, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I missed this before - I think that on Unix test -f link
returns true
(i.e. it's a link and a file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested and you're right, although the man page states
-f file True if file exists and is a regular file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like a wtf and dilutes the power of this test; to test if a file is really a regular file, you'd have to test both -f
and ! -L
.
fixed |
add further types to test(), -L, -e etc
I started adding tests, but the special files caused the tests for
mv
to fail. Also I couldn't figure out how to make a socket.