dir_walker icon indicating copy to clipboard operation
dir_walker copied to clipboard

Tests are still broken.

Open lowks opened this issue 11 years ago • 3 comments

Hi, I see that you have incorporated a version of the fix that I suggested earlier, but today when testing against your latest changes, it would seem that the tests are still broken ?

$ mix test


  1) test stream method works (DirWalkerTest)
     test/dir_walker_test.exs:66
     Assertion with == failed
     code: file == ["test/dir/a.txt"]
     lhs:  ["test/dir/b.txt"]
     rhs:  ["test/dir/a.txt"]
     stacktrace:
       test/dir_walker_test.exs:70



  2) test returns directory names if asked to (DirWalkerTest)
     test/dir_walker_test.exs:41
     Assertion with == failed
     code: length(files) == 2
     lhs:  3
     rhs:  2
     stacktrace:
       test/dir_walker_test.exs:44

.

  3) test traversal in chunks works (DirWalkerTest)
     test/dir_walker_test.exs:12
     Assertion with == failed
     code: files == [path]
     lhs:  ["test/dir/b.txt"]
     rhs:  ["test/dir/a.txt"]
     stacktrace:
       (elixir) lib/enum.ex:1261: Enum."-reduce/3-lists^foldl/2-0-"/3
       test/dir_walker_test.exs:14



  4) test returns only matching names if requested (DirWalkerTest)
     test/dir_walker_test.exs:23
     Assertion with == failed
     code: files == [path]
     lhs:  ["test/dir/c/d/f.txt"]
     rhs:  ["test/dir/a.txt"]
     stacktrace:
       (elixir) lib/enum.ex:1261: Enum."-reduce/3-lists^foldl/2-0-"/3
       test/dir_walker_test.exs:25

..

  5) test basic traversal works (DirWalkerTest)
     test/dir_walker_test.exs:4
     Assertion with == failed
     code: files == ["test/dir/c/d/f.txt", "test/dir/b.txt", "test/dir/a.txt"]
     lhs:  ["test/dir/a.txt", "test/dir/c/d/f.txt", "test/dir/b.txt"]
     rhs:  ["test/dir/c/d/f.txt", "test/dir/b.txt", "test/dir/a.txt"]
     stacktrace:
       test/dir_walker_test.exs:8



  6) test returns directory names and stats if asked to (DirWalkerTest)
     test/dir_walker_test.exs:48
     Assertion with == failed
     code: length(files) == 2
     lhs:  3
     rhs:  2
     stacktrace:
       test/dir_walker_test.exs:53



Finished in 0.1 seconds (0.1s on load, 0.01s on tests)
9 tests, 6 failures

Randomized with seed 486327

Is this some kind of settings that I have on my machine that is producing different output ?

OS: Ubuntu 14.04 Elixir: 1.0.3 Erlang: 17.4 Shells: Zsh and Bash

lowks avatar Apr 06 '15 06:04 lowks

Here's what I see:

[~/tmp] git clone https://github.com/pragdave/dir_walker.git
Cloning into 'dir_walker'...
remote: Counting objects: 101, done.
remote: Total 101 (delta 0), reused 0 (delta 0), pack-reused 101
Receiving objects: 100% (101/101), 13.85 KiB | 0 bytes/s, done.
Resolving deltas: 100% (41/41), done.
Checking connectivity... done.
[~/tmp] cd dir_walker/
[~/t/dir_walker] mix test
Compiled lib/dir_walker.ex
Generated dir_walker.app
.........

Finished in 0.1 seconds (0.1s on load, 0.00s on tests)
9 tests, 0 failures

Randomized with seed 483056
[~/t/dir_walker] 

pragdave avatar Apr 06 '15 14:04 pragdave

Hmm strange testing on my mac at home I got what you got:

Compiled lib/dir_walker.ex
Generated dir_walker.app

DirWalkerTest
  * returns only matching names if requested (6.7ms)
  * stop method works (1.6ms)
  * stream method works (1.8ms)
  * returns directory names if asked to (0.3ms)
  * stream method completes (0.7ms)
  * returns directory names and stats if asked to (0.3ms)
  * basic traversal works (0.8ms)
  * traversal in chunks works (0.6ms)
  * returns stat if asked to (0.4ms)


Finished in 0.1 seconds (0.1s on load, 0.01s on tests)
9 tests, 0 failures

Randomized with seed 526311

What OS were you running the tests on ?

lowks avatar Apr 06 '15 15:04 lowks

Osx

I wonder if it is a case insensitivity issue. I'm at the airport now, but will look later On Apr 6, 2015 10:01 AM, "Low Kian Seong" [email protected] wrote:

Hmm strange testing on my mac at home I got what you got:

Compiled lib/dir_walker.ex Generated dir_walker.app

DirWalkerTest

  • returns only matching names if requested (6.7ms)
  • stop method works (1.6ms)
  • stream method works (1.8ms)
  • returns directory names if asked to (0.3ms)
  • stream method completes (0.7ms)
  • returns directory names and stats if asked to (0.3ms)
  • basic traversal works (0.8ms)
  • traversal in chunks works (0.6ms)
  • returns stat if asked to (0.4ms)

Finished in 0.1 seconds (0.1s on load, 0.01s on tests) 9 tests, 0 failures

Randomized with seed 526311

What OS were you running the tests on ?

— Reply to this email directly or view it on GitHub https://github.com/pragdave/dir_walker/issues/6#issuecomment-90092185.

pragdave avatar Apr 06 '15 16:04 pragdave