-
Notifications
You must be signed in to change notification settings - Fork 189
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
Dir size is the count of children not disk size #104
Conversation
Hmm those tests were failing on my box before I even started working on this pr... I assumed they would pass here but they're still failing. Is this expected? |
I think because assert_cmd was upgraded this caused the tests to fail. I would downgrade it for now. I need to get this looked at sometime. The other thing that catches my eye is that both methods format_string & display_node are now taking a lot of parameters, I wonder if we could put some of them inside 'DisplayData'. I'll pull this branch and have a think about it. |
Actually it is because your branch is using slightly more width on the terminal than the existing branch. Yours is probably correct in this case as it is using an extra character of width which the terminal has. But this means several tests are failing the 'exact match' thing as the percent bars are now 1 or 2 chars longer. |
Merge of #104 and master branch
Another problem is that this branch loses the 'which directory is biggest color' which is applied normally and makes the biggest I tried to merge in the above branch with master here: |
Merge of #104 and master branch
The missing red text I think was a victim of a weird merge. I previously had done some bad math so I fixed that and changed a few tests to assert_eq to get more context in failures. Looks like fixing my math worked. Not sure I have a great idea about all of the params... a bunch of functions take different things so not sure how well abstracting it into a struct would work? I'm open to suggestions! I had an idea about changing how the tests would be done completely to avoid failures on different machines but it would add so much complexity I'm not sure it's the best idea. I'll think on it some more. |
Ah sorry, I've gone on a refactoring mission on my own branch again and caused conflicts. I'm going to play around with this idea too.
I think display_count should be added to the DisplayData struct. |
What was your idea? This area is tricky, so I'd like to hear it. I just started copying the files to a '/tmp/' directory - as it was pointed out to me that /tmp dirs usually use the same filesystem but if you run the tests directly the different filesystems will reserve different amounts of disk for small files. |
Based of #104 Idea is to allow users to find the number of files in each directory instead of size.
Can I get your thoughts on this merge https://github.com/bootandy/dust/pull/109/files ? I based some of it of the work you did here. If you think it is a good idea, we can take your commit adding tests and append it to the above merge. |
I added some comments. Feel free to just close this PR and use yours. As for my testing idea... there are two potential options.
|
Thanks, Testing
But thanks for your ideas anyway. |
Based of #104 Idea is to allow users to find the number of files in each directory instead of size.
Implements #103
Since I was added a new dep, I also sorted/updated the existing deps. If you want me to not do that in this PR I'll revert and just add the new dep.